dkh.graph.directedmst
Calculate directed minimam spanning tree
-
Declaration
struct DirectedMSTInfo(E, C);
-
Declaration
DirectedMSTInfo!(_E, D) directedMST(T, _E = EdgeType!T, D = typeof(_E.dist))(T _g, size_t r);
calc directed mst
Examples
import std.typecons; alias E = Tuple!(int, "to", int, "dist"); E[][] g = new E[][4]; g[0] ~= E(1, 10); g[2] ~= E(1, 10); g[3] ~= E(1, 3); g[2] ~= E(3, 4); auto info = directedMSTSlow(g, 1); assert(info.cost == 17);