type Node … // ID returns the ID number of the node. func (n Node) ID() int { … } type Edge … // From returns the from-node of the edge. func (e Edge) From() graph.Node { … } // To returns the to-node of the edge. func (e Edge) To() graph.Node { … } // Weight returns the weight of the edge. func (e Edge) Weight() float64 { … } const maxInt … // isSame returns whether two float64 values are the same where NaN values // are equalable. func isSame(a, b float64) bool { … }