From d19f38cd441c797c810999c05770ce981d2e53a4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 1 Sep 2009 00:42:14 +0100 Subject: [PATCH] Do not include self-edges in routes --- yarrg/yppedia-chart-parser | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.30.2