directedMST

calc directed mst

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

Examples

1 import std.typecons;
2 alias E = Tuple!(int, "to", int, "dist");
3 
4 E[][] g = new E[][4];
5 g[0] ~= E(1, 10);
6 g[2] ~= E(1, 10);
7 g[3] ~= E(1, 3);
8 g[2] ~= E(3, 4);
9 auto info = directedMSTSlow(g, 1);
10 assert(info.cost == 17);

Meta