Vertices
D4L edited this page Feb 10, 2013
·
1 revision
A vertex is a discrete point in a graph. It is, in essence, the data we are trying to manipulate and conceive.
A vertex can be analysed and manipulated through it's name, which is a string passed when adding the vertex.
Note that this name must be unique to the vertex, so the number of distinct names of vertices in a given graph must be equal to the number of vertices.
adds a vertex to the graph with the specified name
@graph.add_vertex "MyVertex"
will check if the graph has a certain vertex
@graph.has_vertex? "MyVertex"
will delete a vertex from the graph
@graph.delete_vertex "MyVertex"