@ -166,28 +166,29 @@ func (g *Graph) RemoveEdge(edge Edge) {
}
}
// UpEdges returns the vertices connected to the outward edges from the sourc e
// Vertex v.
// UpEdges returns the vertices that are *sources* of edges that target th e
// destination Vertex v.
func ( g * Graph ) UpEdges ( v Vertex ) Set {
return g . upEdgesNoCopy ( v ) . Copy ( )
}
// DownEdges returns the vertices connected from the inward edges to Vertex v.
// DownEdges returns the vertices that are *targets* of edges that originate
// from the source Vertex v.
func ( g * Graph ) DownEdges ( v Vertex ) Set {
return g . downEdgesNoCopy ( v ) . Copy ( )
}
// downEdgesNoCopy returns the outward edges from the source Vertex v as a Set.
// This Set is the same as used internally bu the Graph to prevent a copy, and
// must not be modified by the caller.
// downEdgesNoCopy returns the vertices targeted by edges from the source Vertex
// v as a Set. This Set is the same as used internally by the Graph to prevent a
// copy, and must not be modified by the caller.
func ( g * Graph ) downEdgesNoCopy ( v Vertex ) Set {
g . init ( )
return g . downEdges [ hashcode ( v ) ]
}
// upEdgesNoCopy returns the inward edges to the destination Vertex v as a Set.
// This Set is the same as used internally bu the Graph to prevent a copy, and
// must not be modified by the caller.
// upEdgesNoCopy returns the vertices that are sources of edges targeting the
// destination Vertex v as a Set. This Set is the same as used internally by the
// Graph to prevent a copy, and must not be modified by the caller.
func ( g * Graph ) upEdgesNoCopy ( v Vertex ) Set {
g . init ( )
return g . upEdges [ hashcode ( v ) ]