Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

For example, one can find ends of the path hp and then a path (as a list of vertices) connecting them:

ends = [v for v in hp.vertices() if hp.degree(v)==1]
hp_list = hp.all_paths(*ends)[0]

For example, one can find the ends of in the path graph hp and then a path (as a list of vertices) connecting them:

ends = [v for v in hp.vertices() if hp.degree(v)==1]
hp_list = hp.all_paths(*ends)[0]