AddConnectRoot add 'v' to the DAG 'd' and connect root to 'v'
(v Vertex)
| 137 | |
| 138 | // AddConnectRoot add 'v' to the DAG 'd' and connect root to 'v' |
| 139 | func (d *DAG) AddConnectRoot(v Vertex) bool { |
| 140 | root := d.Root() |
| 141 | if root == nil { |
| 142 | return false |
| 143 | } |
| 144 | return d.AddConnect(root, v) |
| 145 | } |
| 146 | |
| 147 | // WalkTopoOrder walks the DAG 'd' in topology order |
| 148 | func (d *DAG) WalkTopoOrder(walkFunc WalkFunc, less func(v1, v2 Vertex) bool) error { |