// AddEdge add a weighted edge into the weighted graph
AddEdge add a weighted edge into the weighted graph
// AddEdge add a weighted edge into the weighted graph
func (g *WeightedGraph) AddEdge(from, to graph.NodeID, w Weight) error {
	err := g.Graph.AddEdge(from, to)
	if err != nil {
		return err
	}
	g.weights[graph.EdgeID{From: from, To: to}] = w
	return nil
}
func ( g * WeightedGraph ) AddEdge ( from , to graph . NodeID , w Weight ) error { err := g . Graph . AddEdge ( from , to ) if err != nil { return err } g . weights [ graph . EdgeID { From : from , To : to } ] = w return nil }
AddEdge add a weighted edge into the weighted graph
AddEdge add a weighted edge into the weighted graph