graphSeries

@optmath
GraphSeries!(T, I, J)
graphSeries
(
I = uint
J = size_t
T
Range
)
(
in Range[T] aaGraph
)

Parameters

aaGraph Range[T]

graph that is represented as associative array

Return Value

Type: GraphSeries!(T, I, J)

A graph series composed of keys (sorted .index) and arrays of indeces (.data) Complexity: O(log(V) (V + E))

Examples

auto gs = [
    "b" : ["a"],
    "a" : ["b", "c"],
    "c" : ["b"],
].graphSeries;

assert (gs.index == ["a", "b", "c"]); // sorted
assert (gs.data == [
    [1, 2], // a
    [0],    // b
    [1],    // c
]);

Meta