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

@@ -216,6 +216,7 @@ type attrEdge struct {
func (e attrEdge) From() graph.Node { return e.from }
func (e attrEdge) To() graph.Node { return e.to }
func (e attrEdge) ID() int64 { return 0 }
func (e attrEdge) Weight() float64 { return 0 }
func (e attrEdge) Attributes() []encoding.Attribute { return e.attr }
@@ -254,6 +255,7 @@ type portedEdge struct {
func (e portedEdge) From() graph.Node { return e.from }
func (e portedEdge) To() graph.Node { return e.to }
func (e portedEdge) ID() int64 { return 0 }
func (e portedEdge) Weight() float64 { return 0 }
// TODO(kortschak): Figure out a better way to handle the fact that