graph: change Edge interface to include ID method

This is to allow future handling of multigraphs.
This commit is contained in:
kortschak
2017-12-09 10:14:14 +10:30
committed by Dan Kortschak
parent d3ba8c418d
commit 1a83fdba7a
7 changed files with 29 additions and 2 deletions

View File

@@ -101,6 +101,9 @@ func (e CliqueGraphEdge) From() graph.Node { return e.from }
// To returns the to node of the edge.
func (e CliqueGraphEdge) To() graph.Node { return e.to }
// ID returns zero.
func (e CliqueGraphEdge) ID() int64 { return 0 }
// Nodes returns the common nodes in the cliques of the underlying graph
// corresponding to the from and to nodes in the clique graph.
func (e CliqueGraphEdge) Nodes() []graph.Node { return e.nodes }