Ask Your Question

Revision history [back]

all_simple_paths generates AttributeError for graphs

Minimum working example (which causes error on CoCalc, but also on my own machine):

G = graphs.CompleteGraph(5)
G.all_paths(1,3)
G.all_simple_paths()

This gives an error saying that "all_simple_paths" is not an attribute for the "Graph" object, even though the function is present in the sage.graphs.path_enumeration module, where all_paths is from the line above, which works just fine. I have checked other functions in the module and found that other than all_paths, shortest_simple_paths seems to be the only other one in this module which works. The rest also give attribute errors.

I am wanting to use the all_simple_paths function due to its ability to have accept a list of starting and ending vertices, instead of just one start and end like the all_paths function. However, it refuses to work. Trying to import the module manually does not seem to effect anything. Does anyone know why this function does not work?