Skip to content

Commit

Permalink
graph/graphs/gen: allow dst to determine first ID number
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Jun 8, 2017
1 parent 3724382 commit d3dceef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions graph/graphs/gen/duplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ func Duplication(dst UndirectedMutator, n int, delta, alpha, sigma float64, src
sort.Sort(ordered.ByID(nodes))
if len(nodes) == 0 {
n--
dst.AddNode(simple.Node(0))
nodes = append(nodes, simple.Node(0))
u := simple.Node(dst.NewNodeID())
dst.AddNode(u)
nodes = append(nodes, u)
}
for i := 0; i < n; i++ {
u := nodes[rndN(len(nodes))]
Expand Down

0 comments on commit d3dceef

Please sign in to comment.