-
Notifications
You must be signed in to change notification settings - Fork 9
Under the hood
Peter Corke edited this page Jun 26, 2021
·
3 revisions
The graph has:
-
_vertexlista list of all vertices have a back reference in order of addition -
_vertexdicta dictionary of all vertices indexed by name -
_edgelista list of all edges
Every vertex has:
-
coordthe coordinate of the vertex if the graph is embedded -
_edgelista list of all edges starting at this vertex. For an undirected graph this is all edges, for a directed graph this is all edges leaving this vertex -
namea unique name, if not given a name of the form#Nis given whereNis the index of the vertex in the graph's_vertexlist - a back reference to its owning graph which is set when the vertex is added to the graph by
add_vertex. This means a vertex can only be in one graph.
Every edge has:
- a reference to the vertices which are its endpoints
-
costwhich is the cost of traversing the edge -
datawhich is a reference to arbitrary user data associated with the edge. A more general approach is to subclassEdge.
The key objects and their interactions are shown below.
