Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Graphs belong to the class `UGraph` or `DGraph` for undirected or directed graph
- `g.incidence()` incidence matrix

### Properties and methods of a vertex
Vertices belong to the class `UVertex` (for undirected graphs) or `DVertex` (for directed graphs), which are each subclasses of `BaseVertex`.
Vertices belong to the class `UVertex` (for undirected graphs) or `DVertex` (for directed graphs), which are each subclasses of `Vertex`.

- `v.coord` the coordinate vector for embedded graph (optional)
- `v.name` the name of the vertex (optional)
Expand Down
80 changes: 40 additions & 40 deletions docs/source/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,55 +13,55 @@ Graph
.. autosummary::
:nosignatures:

~pgraph.PGraph.BaseGraph.n
~pgraph.PGraph.BaseGraph.ne
~pgraph.PGraph.BaseGraph.nc
~pgraph.PGraph.BaseGraph.edges
~pgraph.PGraph.BaseGraph.average_degree
~pgraph.PGraph.BaseGraph.iscyclic
~pgraph.PGraph.BaseGraph.connectivity
~pgraph.PGraph.BaseGraph.component
~pgraph.PGraph.BaseGraph.samecomponent
~pgraph.PGraph.BaseGraph.closest
~pgraph.PGraph.Graph.n
~pgraph.PGraph.Graph.ne
~pgraph.PGraph.Graph.nc
~pgraph.PGraph.Graph.edges
~pgraph.PGraph.Graph.average_degree
~pgraph.PGraph.Graph.iscyclic
~pgraph.PGraph.Graph.connectivity
~pgraph.PGraph.Graph.component
~pgraph.PGraph.Graph.samecomponent
~pgraph.PGraph.Graph.closest

Vertex
------

.. autosummary::
:nosignatures:

~pgraph.PGraph.BaseVertex.edges
~pgraph.PGraph.BaseVertex.adjacent
~pgraph.PGraph.BaseVertex.isadjacent
~pgraph.PGraph.BaseVertex.incidences
~pgraph.PGraph.BaseVertex.degree
~pgraph.PGraph.BaseVertex.heuristic_distance
~pgraph.PGraph.BaseVertex.distance
~pgraph.PGraph.BaseVertex.x
~pgraph.PGraph.BaseVertex.y
~pgraph.PGraph.BaseVertex.z
~pgraph.PGraph.Vertex.edges
~pgraph.PGraph.Vertex.adjacent
~pgraph.PGraph.Vertex.isadjacent
~pgraph.PGraph.Vertex.incidences
~pgraph.PGraph.Vertex.degree
~pgraph.PGraph.Vertex.heuristic_distance
~pgraph.PGraph.Vertex.distance
~pgraph.PGraph.Vertex.x
~pgraph.PGraph.Vertex.y
~pgraph.PGraph.Vertex.z

Details
-------

.. autoproperty:: pgraph.PGraph.BaseGraph.n
.. autoproperty:: pgraph.PGraph.BaseGraph.ne
.. autoproperty:: pgraph.PGraph.BaseGraph.nc
.. automethod:: pgraph.PGraph.BaseGraph.edges
.. automethod:: pgraph.PGraph.BaseGraph.average_degree
.. automethod:: pgraph.PGraph.BaseGraph.iscyclic
.. automethod:: pgraph.PGraph.BaseGraph.connectivity
.. automethod:: pgraph.PGraph.BaseGraph.component
.. automethod:: pgraph.PGraph.BaseGraph.samecomponent
.. automethod:: pgraph.PGraph.BaseGraph.closest
.. autoproperty:: pgraph.PGraph.Graph.n
.. autoproperty:: pgraph.PGraph.Graph.ne
.. autoproperty:: pgraph.PGraph.Graph.nc
.. automethod:: pgraph.PGraph.Graph.edges
.. automethod:: pgraph.PGraph.Graph.average_degree
.. automethod:: pgraph.PGraph.Graph.iscyclic
.. automethod:: pgraph.PGraph.Graph.connectivity
.. automethod:: pgraph.PGraph.Graph.component
.. automethod:: pgraph.PGraph.Graph.samecomponent
.. automethod:: pgraph.PGraph.Graph.closest

.. automethod:: pgraph.PGraph.BaseVertex.edges
.. automethod:: pgraph.PGraph.BaseVertex.adjacent
.. automethod:: pgraph.PGraph.BaseVertex.isadjacent
.. automethod:: pgraph.PGraph.BaseVertex.incidences
.. autoproperty:: pgraph.PGraph.BaseVertex.degree
.. automethod:: pgraph.PGraph.BaseVertex.heuristic_distance
.. automethod:: pgraph.PGraph.BaseVertex.distance
.. autoproperty:: pgraph.PGraph.BaseVertex.x
.. autoproperty:: pgraph.PGraph.BaseVertex.y
.. autoproperty:: pgraph.PGraph.BaseVertex.z
.. automethod:: pgraph.PGraph.Vertex.edges
.. automethod:: pgraph.PGraph.Vertex.adjacent
.. automethod:: pgraph.PGraph.Vertex.isadjacent
.. automethod:: pgraph.PGraph.Vertex.incidences
.. autoproperty:: pgraph.PGraph.Vertex.degree
.. automethod:: pgraph.PGraph.Vertex.heuristic_distance
.. automethod:: pgraph.PGraph.Vertex.distance
.. autoproperty:: pgraph.PGraph.Vertex.x
.. autoproperty:: pgraph.PGraph.Vertex.y
.. autoproperty:: pgraph.PGraph.Vertex.z
6 changes: 3 additions & 3 deletions docs/source/common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Common methods
The package supports both directed (prefix ``D``) and undirected graphs (prefix ``U``), and the classes for these
share a common interface.

The graph classes represent a single graph, either directed or undirected, and they share :class:`BaseGraph`:
The graph classes represent a single graph, either directed or undirected, and they share :class:`Graph`:

.. inheritance-diagram:: pgraph.PGraph.UGraph pgraph.PGraph.DGraph
:parts: 1
:private-bases:
:top-classes: pgraph.PGraph.BaseGraph
:top-classes: pgraph.PGraph.Graph

The vertices in a directed graph (``DGraph``) inherit from :class:`DVertex` and the
vertices in an undirected graph (``UGraph``) inherit from :class:`UVertex`.
Expand All @@ -19,7 +19,7 @@ vertices in an undirected graph (``UGraph``) inherit from :class:`UVertex`.

The vertex classes share
almost their entire interface, defined once on their common base classes
(:class:`BaseGraph`, :class:`BaseVertex`). This section documents that
(:class:`Graph`, :class:`Vertex`). This section documents that
shared interface by task rather than by class; see :doc:`construction` for
the :class:`DGraph` and :class:`UGraph` classes and :doc:`edges_vertices` for
what's specific to directed vs. undirected vertices.
Expand Down
10 changes: 5 additions & 5 deletions docs/source/construction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ standalone, independent of a graph.

~pgraph.PGraph.DGraph
~pgraph.PGraph.UGraph
~pgraph.PGraph.BaseGraph.Dict
~pgraph.PGraph.BaseGraph.Adjacency
~pgraph.PGraph.Graph.Dict
~pgraph.PGraph.Graph.Adjacency


.. autoclass:: pgraph.PGraph.DGraph
Expand All @@ -22,17 +22,17 @@ standalone, independent of a graph.
.. autoclass:: pgraph.PGraph.UGraph
:show-inheritance:

.. autoclass:: pgraph.PGraph.BaseGraph.Adjacency
.. autoclass:: pgraph.PGraph.Graph.Adjacency
:show-inheritance:

.. autoclass:: pgraph.PGraph.BaseGraph.Dict
.. autoclass:: pgraph.PGraph.Graph.Dict
:show-inheritance:


Inherited methods for all graph types
--------------------------------------

.. autoclass:: pgraph.PGraph.BaseGraph
.. autoclass:: pgraph.PGraph.Graph
:members: copy, vertex_copy, metric, heuristic, show, vertex_class, edge_class
:special-members: __init__, __str__, __repr__, __getitem__, __iter__, __contains__

Expand Down
8 changes: 4 additions & 4 deletions docs/source/export.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ it.
.. autosummary::
:nosignatures:

~pgraph.PGraph.BaseGraph.export
~pgraph.PGraph.BaseGraph.dotfile
~pgraph.PGraph.Graph.export
~pgraph.PGraph.Graph.dotfile

Details
-------

.. automethod:: pgraph.PGraph.BaseGraph.export
.. automethod:: pgraph.PGraph.BaseGraph.dotfile
.. automethod:: pgraph.PGraph.Graph.export
.. automethod:: pgraph.PGraph.Graph.dotfile
30 changes: 15 additions & 15 deletions docs/source/modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@ Graph
.. autosummary::
:nosignatures:

~pgraph.PGraph.BaseGraph.add_vertex
~pgraph.PGraph.BaseGraph.add_edge
~pgraph.PGraph.BaseGraph.remove_edge
~pgraph.PGraph.BaseGraph.remove_vertex
~pgraph.PGraph.Graph.add_vertex
~pgraph.PGraph.Graph.add_edge
~pgraph.PGraph.Graph.remove_edge
~pgraph.PGraph.Graph.remove_vertex

Vertex
------

.. autosummary::
:nosignatures:

~pgraph.PGraph.BaseVertex.connect
~pgraph.PGraph.BaseVertex.edgeto
~pgraph.PGraph.BaseVertex.remove
~pgraph.PGraph.Vertex.connect
~pgraph.PGraph.Vertex.edgeto
~pgraph.PGraph.Vertex.remove

Details
-------

.. automethod:: pgraph.PGraph.BaseGraph.add_vertex
.. automethod:: pgraph.PGraph.BaseGraph.add_edge
.. automethod:: pgraph.PGraph.BaseGraph.remove_edge
.. automethod:: pgraph.PGraph.BaseGraph.remove_vertex
.. automethod:: pgraph.PGraph.BaseGraph.remove
.. automethod:: pgraph.PGraph.Graph.add_vertex
.. automethod:: pgraph.PGraph.Graph.add_edge
.. automethod:: pgraph.PGraph.Graph.remove_edge
.. automethod:: pgraph.PGraph.Graph.remove_vertex
.. automethod:: pgraph.PGraph.Graph.remove

.. automethod:: pgraph.PGraph.BaseVertex.connect
.. automethod:: pgraph.PGraph.BaseVertex.edgeto
.. automethod:: pgraph.PGraph.BaseVertex.remove
.. automethod:: pgraph.PGraph.Vertex.connect
.. automethod:: pgraph.PGraph.Vertex.edgeto
.. automethod:: pgraph.PGraph.Vertex.remove
12 changes: 6 additions & 6 deletions docs/source/planning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ These methods find optimal paths from a start vertex to a goal vertex.
.. autosummary::
:nosignatures:

~pgraph.PGraph.BaseGraph.path_BFS
~pgraph.PGraph.BaseGraph.path_UCS
~pgraph.PGraph.BaseGraph.path_Astar
~pgraph.PGraph.Graph.path_BFS
~pgraph.PGraph.Graph.path_UCS
~pgraph.PGraph.Graph.path_Astar

Details
-------

.. automethod:: pgraph.PGraph.BaseGraph.path_BFS
.. automethod:: pgraph.PGraph.BaseGraph.path_UCS
.. automethod:: pgraph.PGraph.BaseGraph.path_Astar
.. automethod:: pgraph.PGraph.Graph.path_BFS
.. automethod:: pgraph.PGraph.Graph.path_UCS
.. automethod:: pgraph.PGraph.Graph.path_Astar
6 changes: 3 additions & 3 deletions docs/source/policy.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Object lifecycle and graph-membership policy
=============================================

``BaseVertex``, ``UVertex``, ``DVertex`` and ``Edge`` can all be constructed
``Vertex``, ``UVertex``, ``DVertex`` and ``Edge`` can all be constructed
directly, independent of any graph. This is deliberate -- it is not an
oversight and not a "factory-only" design -- but it means the rules for what
those objects can and can't do *before* they belong to a graph need to be
Expand All @@ -26,7 +26,7 @@ Adding a vertex to a graph
:meth:`UGraph.add_vertex` and :meth:`DGraph.add_vertex` each only accept
their own matching vertex subclass -- a ``UVertex`` (or coordinate data, from
which one is built) for :class:`UGraph`, a ``DVertex`` for :class:`DGraph`.
Passing the wrong kind of vertex -- a plain ``BaseVertex``, or the other
Passing the wrong kind of vertex -- a plain ``Vertex``, or the other
graph's subclass -- raises ``TypeError`` rather than being silently accepted
or converted.

Expand Down Expand Up @@ -79,7 +79,7 @@ Summary
* - Operation
- Requires graph membership?
- Failure mode
* - ``UVertex()`` / ``DVertex()`` / ``BaseVertex()``
* - ``UVertex()`` / ``DVertex()`` / ``Vertex()``
- No
- --
* - ``Edge(v1, v2)``
Expand Down
20 changes: 10 additions & 10 deletions docs/source/representations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ These methods convert the graph to a number of different matrix representations.
.. autosummary::
:nosignatures:

~pgraph.PGraph.BaseGraph.distance
~pgraph.PGraph.BaseGraph.adjacency
~pgraph.PGraph.BaseGraph.degree
~pgraph.PGraph.BaseGraph.incidence
~pgraph.PGraph.BaseGraph.laplacian
~pgraph.PGraph.Graph.distance
~pgraph.PGraph.Graph.adjacency
~pgraph.PGraph.Graph.degree
~pgraph.PGraph.Graph.incidence
~pgraph.PGraph.Graph.laplacian

Details
-------

.. automethod:: pgraph.PGraph.BaseGraph.distance
.. automethod:: pgraph.PGraph.BaseGraph.adjacency
.. automethod:: pgraph.PGraph.BaseGraph.degree
.. automethod:: pgraph.PGraph.BaseGraph.incidence
.. automethod:: pgraph.PGraph.BaseGraph.laplacian
.. automethod:: pgraph.PGraph.Graph.distance
.. automethod:: pgraph.PGraph.Graph.adjacency
.. automethod:: pgraph.PGraph.Graph.degree
.. automethod:: pgraph.PGraph.Graph.incidence
.. automethod:: pgraph.PGraph.Graph.laplacian


20 changes: 10 additions & 10 deletions docs/source/visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ file) rather than displaying it.
.. autosummary::
:nosignatures:

~pgraph.PGraph.BaseGraph.plot
~pgraph.PGraph.BaseGraph.showgraph
~pgraph.PGraph.BaseGraph.highlight_path
~pgraph.PGraph.BaseGraph.highlight_edge
~pgraph.PGraph.BaseGraph.highlight_vertex
~pgraph.PGraph.Graph.plot
~pgraph.PGraph.Graph.showgraph
~pgraph.PGraph.Graph.highlight_path
~pgraph.PGraph.Graph.highlight_edge
~pgraph.PGraph.Graph.highlight_vertex

Details
-------

.. automethod:: pgraph.PGraph.BaseGraph.plot
.. automethod:: pgraph.PGraph.BaseGraph.showgraph
.. automethod:: pgraph.PGraph.BaseGraph.highlight_path
.. automethod:: pgraph.PGraph.BaseGraph.highlight_edge
.. automethod:: pgraph.PGraph.BaseGraph.highlight_vertex
.. automethod:: pgraph.PGraph.Graph.plot
.. automethod:: pgraph.PGraph.Graph.showgraph
.. automethod:: pgraph.PGraph.Graph.highlight_path
.. automethod:: pgraph.PGraph.Graph.highlight_edge
.. automethod:: pgraph.PGraph.Graph.highlight_vertex
Loading
Loading