(edges []int)
| 110 | } |
| 111 | |
| 112 | func (d *DAG) fmtEdges(edges []int) interface{} { |
| 113 | var s []string |
| 114 | for _, edge := range edges { |
| 115 | if d.vertexes[edge].name != "" { |
| 116 | s = append(s, fmt.Sprintf("%d: %s", edge, d.vertexes[edge].name)) |
| 117 | } else { |
| 118 | s = append(s, fmt.Sprintf("%d", edge)) |
| 119 | } |
| 120 | } |
| 121 | return strings.Join(s, " -> ") |
| 122 | } |
| 123 | |
| 124 | // order returns the total number of nodes in the graph |
| 125 | func (d *DAG) order() int { |