S
Sean
I have a directed graph looks like the following (see the figure).
Edges in the original directed graph:
[main] -> [foo]; [main] -> [bar];
[foo] -> [trouble];
[trouble] -> [foo];
I want to find all the cycles. After I find a cycle, I want to break it
by deleting an edge starting a 'farther' vertice from node [main]---in
this case, deleting [trouble] -> [foo] to get the following graph
Edges after manipulation:
[main] -> [foo]; [main] -> [bar];
[foo] -> [trouble];
---------------------------------------------------------
[main]
/ \
[foo] [bar]
/ /
/ /
[trouble]
---------------------------------------------------------------
I tried to use @v = $g->connected_component_by_index($i), but it seems
to return single nodes (which is deemed as strongly connected component
itself), which is not what I want.
$g->find_a_cycle does not work either, because it returns same cycle no
matter how many times you call it.
I am newbie in perl. Can someone give me a suggestion how to utilize
the existing APIs in Graph.0.69?
Edges in the original directed graph:
[main] -> [foo]; [main] -> [bar];
[foo] -> [trouble];
[trouble] -> [foo];
I want to find all the cycles. After I find a cycle, I want to break it
by deleting an edge starting a 'farther' vertice from node [main]---in
this case, deleting [trouble] -> [foo] to get the following graph
Edges after manipulation:
[main] -> [foo]; [main] -> [bar];
[foo] -> [trouble];
---------------------------------------------------------
[main]
/ \
[foo] [bar]
/ /
/ /
[trouble]
---------------------------------------------------------------
I tried to use @v = $g->connected_component_by_index($i), but it seems
to return single nodes (which is deemed as strongly connected component
itself), which is not what I want.
$g->find_a_cycle does not work either, because it returns same cycle no
matter how many times you call it.
I am newbie in perl. Can someone give me a suggestion how to utilize
the existing APIs in Graph.0.69?