-
Notifications
You must be signed in to change notification settings - Fork 1
Cycles
James Bremner edited this page Mar 29, 2023
·
10 revisions
This option finds the cycles in a graph. For undirected graphs, 'cycles' that involve shuttling back and forth along a single edge are ignored.
The first line specifies the calculation required. It must contain
format cycle
Column | Description |
---|---|
1 | l for link |
2 | src node name |
3 | dst node name |
Column | Description |
---|---|
1 | s |
2 | starting node name |
format cycle
l a b
l b c
l c d
l d a
s a
The algorithm is a modified depth first search. When a previously visited vertex is reached, the Dijsktra algorithm is applied to find the path that forms the shortest cycle that leads back to the back edge to the previously visited vertex.