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]
2 | No.2 Revision |
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]