+sub yppedia_graphs_add_shortcuts () {
+ # We add edges between LPs we know about, as you can chart
+ # between them. Yppedia often lacks these edges.
+ #
+ foreach my $p ($widists->vertices) {
+ my ($ax,$ay) = $p =~ m/^(\d+)\,(\d+)$/ or die;
+ my $add_shortcut= sub {
+ my $q= sprintf "%d,%d", $ax+$_[0], $ay+$_[1];
+ return unless $widists->has_vertex($q);
+ return if $widists->has_edge($p,$q);
+ printf DEBUG "%-5s league-shortcut %-5s\n", $p, $q;
+ $widists->add_weighted_edge($p,$q,1);
+ };
+ $add_shortcut->( 2,0);
+ $add_shortcut->(+1,1);
+ $add_shortcut->(-1,1);
+ }
+}
+