From: Ian Jackson Date: Mon, 31 Aug 2009 23:42:14 +0000 (+0100) Subject: Do not include self-edges in routes X-Git-Tag: 3.4~51 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=commitdiff_plain;h=d19f38cd441c797c810999c05770ce981d2e53a4 Do not include self-edges in routes --- diff --git a/yarrg/yppedia-chart-parser b/yarrg/yppedia-chart-parser index 228d1e2..54a0e45 100755 --- a/yarrg/yppedia-chart-parser +++ b/yarrg/yppedia-chart-parser @@ -423,7 +423,8 @@ sub shortest_path_reduction ($$) { 1. F is an undirected weighted graph with positive edge weights. - 2. All graphs we will consider have the same vertices as F. + 2. All graphs we will consider have the same vertices as F + and none have self-edges. 3. G = Closure(F) is the graph of cliques whose edge weights are the shortest paths in F, one clique for each connected @@ -480,6 +481,7 @@ END my $result= Graph::Undirected->new(); foreach my $edge_ac ($g->edges()) { + next if $edge_ac->[0] eq $edge_ac->[1]; my $edgename_ac= join ' .. ', @$edge_ac; printf DEBUG "spr %s edge %s\n", $what, $edgename_ac; my $w_ac= $g->get_edge_weight(@$edge_ac);