graphs/gen: TunableClusteringScaleFree does not correctly set up initial state for graph
Created by: kortschak
The algorithm asks that the graph be initialised with m nodes and no edges. Currently it will panic if given a dst
with any nodes in {1, 2, ... m-1} because of a typo in that loop.
// Initial condition.
wt := make([]float64, n)
for u := 0; u < m; u++ {
if !dst.Has(int64(0)) {
dst.AddNode(simple.Node(u))
}
// We need to give equal probability for
// adding the first generation of edges.
wt[u] = 1
}
While fixing that, dst.NewNode
should also be used in place of simple.Node
(and simple.Edge
elsewhere).