"Source: Text/Incidence/MultiGraph.text";
"Line: 3765";
"Date: Fri Sep 26 12:10:10 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Incidence/MultiGraph.text, line: 3765
// Example: H163E12 ()
print "Example: H163E12";
ei := GetEchoInput();
SetEchoInput(true);
G := MultiDigraph< 5 | [1, 2], [1, 2], [1, 3], [2, 4], [3, 5], [3, 4], [4, 5] >;
E := EdgeSet(G);
AssignWeight(~G, E.1, 1);
AssignWeight(~G, E.2, 5);
AssignWeight(~G, E.3, 10);
AssignWeight(~G, E.4, 1);
AssignWeight(~G, E.5, -5);
AssignWeight(~G, E.6, 1);
AssignWeight(~G, E.7, 2);


V := VertexSet(G);
E := EdgeSet(G);
for e in E do
    e, "  ", Weight(e);
end for;
HasNegativeWeightCycle(V!1);
assert not $1;
b, d := Reachable(V!1, V!5);
assert b;
P := Path(V!1, V!5);
G := Geodesic(V!1, V!5);

d;
assert $1 eq 4;
P;
G;
dP := 0;
for e in P do
    dP +:= Weight(e);
end for;
assert dP eq d;
SetEchoInput(ei);
