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

@@ -224,6 +224,7 @@ type weightedEdge struct {
func (e weightedEdge) From() graph.Node { return e.from }
func (e weightedEdge) To() graph.Node { return e.to }
func (e weightedEdge) ID() int64 { return 0 }
func (e weightedEdge) Weight() float64 { return e.cost }
func isMonotonic(g UndirectedWeightLister, h Heuristic) (ok bool, at graph.Edge, goal graph.Node) {