Quantcast
Channel: ASKSAGE: Sage Q&A Forum - RSS feed
Browsing latest articles
Browse All 2 View Live

Answer by Max Alekseyev for For directed graphs, we have a built-in command...

There is no need to reverse and eliminate cycles - instead, to fix a cycle direction it's enough to compare the second vertex with the second but last vertex: g = graphs.CompleteGraph(4)...

View Article



Find all cycles in an undirected graph

For **directed** graphs, we have a built-in command `all_simple_cycles` to search for specific length cycles or all cycles. However, it is indeed strange that there is no readily available command for...

View Article
Browsing latest articles
Browse All 2 View Live


Latest Images