directedMST

calc directed mst

directedMST
(
T
_E = EdgeType!T
D = typeof(_E.dist)
)
(
T _g
,
size_t r
)

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);

Meta