func (graph *Graph) ConvertToEdgeList() [][]int {
	edges := make([][]int, 0, graph.NodeCount())
	for _, node := range graph.Nodes {
		list := make([]int, 0, len(node.Out))
		for _, out := range node.Out {
			list = append(list, int(out.ID))
		}
		edges = append(edges, list)
	}
	return edges
}
ConvertToEdgeList creates edge list
NewGraphFromEdgeList(edgeList).ConvertToEdgeList() == edgeList
package hier
func NewGraphFromEdgeList(edgeList [][]int) *Graph {
	graph := NewGraph()
	for from, out := range edgeList {
		for _, to := range out {
			graph.ensureNode(from)
			graph.ensureNode(to)
			graph.AddEdge(graph.Nodes[from], graph.Nodes[to])
		}
	}
	return graph
}