Skip to content

Commit

Permalink
Merge pull request #885 from vidhan13j07/gsoc/rewritetrsp
Browse files Browse the repository at this point in the history
Integrating pgr_lineGraph with pgr_dijkstraTRSP
  • Loading branch information
cvvergara authored Aug 6, 2017
2 parents 0d56b28 + 8d9f64b commit 63b9cc1
Show file tree
Hide file tree
Showing 123 changed files with 2,136 additions and 1,642 deletions.
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at project@pgrouting.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
File renamed without changes.
3 changes: 0 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,10 @@ To see the issues closed by this release see the [Git closed issues for 2.5.0 ](
* pgr_bdDijkstraCost(many to one)
* pgr_bdDijkstraCost(many to many)
* pgr_bdDijkstraCostMatrix
* pgr_pgr_pickDeliver
* pgr_pgr_pickDeliverEuclidean

*Deprecated Signatures*

* pgr_bdastar - use pgr_bdAstar instead
* pgr_gsoc_vrppdtw - use pgr_pickDeliverEuclidean instead

*Renamed Functions*

Expand Down
2 changes: 1 addition & 1 deletion ci/appveyor/install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ if not exist "C:\Progra~1\PostgreSQL\9.4\makepostgisdb_using_extensions.bat" (
if not exist %DOWNLOADS_DIR%\postgis-pg94-binaries-%PG_VERSION%w%arch%gcc48.zip (
echo Downloading PostGIS %PG_VERSION%
pushd %DOWNLOADS_DIR%
curl -L -O -S -s http://winnie.postgis.net/download/windows/pg94/buildbot/postgis-pg94-binaries-%PG_VERSION%w%arch%gcc48.zip
curl -L -O -S -s http://winnie.postgis.net/download/windows/pg94/buildbot/archive/postgis-pg94-binaries-%PG_VERSION%w%arch%gcc48.zip
popd
if not exist %DOWNLOADS_DIR%\postgis-pg94-binaries-%PG_VERSION%w%arch%gcc48.zip (
echo something went wrong on PostGIS %PG_VERSION% download !!!!!!!!!
Expand Down
3 changes: 2 additions & 1 deletion configuration.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ bdDijkstra | Y | Y | Y
trsp | Y | Y | Y
max_flow | Y | Y | Y
contraction | Y | Y | Y
pickDeliver | Y | Y | Y
pickDeliver | Y | Y | N
vrp_basic | N | Y | Y
vrppdtw | N | Y | Y
withPoints | Y | Y | Y
dijkstraTRSP | Y | Y | Y
lineGraph | Y | Y | Y
Expand Down
4 changes: 3 additions & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ endif()


# configured documentation tools and intermediate build results
set(PGR_DOCUMENTATION_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
# TODO for 3.0 Use _build
# set(PGR_DOCUMENTATION_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
set(PGR_DOCUMENTATION_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(PGR_DOCUMENTATION_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}")

message(STATUS "PGR_DOCUMENTATION_BUILD_DIR = ${PGR_DOCUMENTATION_BUILD_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion doc/allpairs/pgr_floydWarshall.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ See Also

* :ref:`pgr_johnson`
* `Boost floyd-Warshall <http://www.boost.org/libs/graph/doc/floyd_warshall_shortest.html>`_ algorithm
* Queries uses the :ref:`sampledata` network.
* Queries uses the :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion doc/allpairs/pgr_johnson.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ See Also

* :ref:`pgr_floydWarshall`
* `Boost Johnson <http://www.boost.org/libs/graph/doc/johnson_all_pairs_shortest.html>`_ algorithm implementation.
* Queries uses the :ref:`sampledata` network.
* Queries uses the :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion doc/alpha_shape/pgr_alphaShape.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Steps:



The queries use the :ref:`sampledata` network.
The queries use the :doc:`sampledata` network.

See Also
-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/alpha_shape/pgr_pointsAsPolygon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ In the following query there is no way to control which point in the polygon is
:end-before: --q2


The query use the :ref:`sampledata` network.
The query use the :doc:`sampledata` network.


See Also
Expand Down
2 changes: 1 addition & 1 deletion doc/astar/pgr_aStar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ See Also
-------------------------------------------------------------------------------

* :ref:`astar`
* :ref:`sampledata`
* :doc:`sampledata`
* http://www.boost.org/libs/graph/doc/astar_search.html
* http://en.wikipedia.org/wiki/A*_search_algorithm

Expand Down
2 changes: 1 addition & 1 deletion doc/astar/pgr_aStarCost.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,6 @@ See Also
-------------------------------------------------------------------------------

* :ref:`astar`.
* :ref:`sampledata` network.
* :doc:`sampledata` network.
* http://www.boost.org/libs/graph/doc/astar_search.html
* http://en.wikipedia.org/wiki/A*_search_algorithm
2 changes: 1 addition & 1 deletion doc/bdAstar/pgr_bdAstar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ See Also
-------------------------------------------------------------------------------

* :ref:`bdAstar`
* :ref:`sampledata` network.
* :doc:`sampledata` network.
* http://www.boost.org/libs/graph/doc/astar_search.html
* http://en.wikipedia.org/wiki/A*_search_algorithm

Expand Down
2 changes: 1 addition & 1 deletion doc/bdAstar/pgr_bdAstarCost.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ See Also
-------------------------------------------------------------------------------

* :ref:`bdAstar`
* :ref:`sampledata` network.
* :doc:`sampledata` network.
* `Migration Guide <https://github.com/cvvergara/pgrouting/wiki/Migration-Guide#pgr_bdastar>`_
* http://www.boost.org/libs/graph/doc/astar_search.html
* http://en.wikipedia.org/wiki/A*_search_algorithm
Expand Down
2 changes: 1 addition & 1 deletion doc/bdDijkstra/pgr_bdDijkstra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Description of the Signatures
See Also
-------------------------------------------------------------------------------

* The queries use the :ref:`sampledata` network.
* The queries use the :doc:`sampledata` network.
* :ref:`bdDijkstra`
* http://www.cs.princeton.edu/courses/archive/spr06/cos423/Handouts/EPP%20shortest%20path%20algorithms.pdf
* https://en.wikipedia.org/wiki/Bidirectional_search
Expand Down
2 changes: 1 addition & 1 deletion doc/bdDijkstra/pgr_bdDijkstraCost.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Description of the Signatures
See Also
-------------------------------------------------------------------------------

* The queries use the :ref:`sampledata` network.
* The queries use the :doc:`sampledata` network.
* :ref:`pgr_bdDijkstra`
* http://www.cs.princeton.edu/courses/archive/spr06/cos423/Handouts/EPP%20shortest%20path%20algorithms.pdf
* https://en.wikipedia.org/wiki/Bidirectional_search
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ latex_documents = [

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = "static/images/pgrouting.png"
latex_logo = "_static/images/pgrouting.png"

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
Expand Down
4 changes: 2 additions & 2 deletions doc/contraction/contraction-family.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Contracting Sample Data

In this section, building and using a contracted graph will be shown by example.

- The :ref:`sampledata` for an undirected graph is used
- The :doc:`sampledata` for an undirected graph is used
- a dead end operation first followed by a linear operation.

The original graph:
Expand Down Expand Up @@ -518,7 +518,7 @@ See Also

* http://www.cs.cmu.edu/afs/cs/academic/class/15210-f12/www/lectures/lecture16.pdf
* http://algo2.iti.kit.edu/documents/routeplanning/geisberger_dipl.pdf
* The queries use :ref:`pgr_contractGraph` function and the :ref:`sampledata` network.
* The queries use :ref:`pgr_contractGraph` function and the :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion doc/costMatrix/pgr_aStarCostMatrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ See Also
* :ref:`astar`
* :ref:`costMatrix`
* :ref:`tsp`
* The queries use the :ref:`sampledata` network.
* The queries use the :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion doc/costMatrix/pgr_bdAstarCostMatrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ See Also
* :ref:`bdAstar`
* :ref:`costMatrix`
* :ref:`tsp`
* The queries use the :ref:`sampledata` network.
* The queries use the :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion doc/costMatrix/pgr_bdDijkstraCostMatrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ See Also
* :ref:`bdDijkstra`
* :ref:`costMatrix`
* :ref:`tsp`
* The queries use the :ref:`sampledata` network.
* The queries use the :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion doc/costMatrix/pgr_dijkstraCostMatrix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ See Also
* :ref:`dijkstra`
* :ref:`costMatrix`
* :ref:`tsp`
* The queries use the :ref:`sampledata` network.
* The queries use the :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
41 changes: 29 additions & 12 deletions doc/dijkstra/dijkstra-family.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ where :math:`sql = \{(id_i, source_i, target_i, cost_i, reverse\_cost_i)\}`

and

- :math:`source = \bigcup source_i`,
- :math:`target = \bigcup target_i`,
- :math:`source = \bigcup source_i`,
- :math:`target = \bigcup target_i`,

The graphs are defined as follows:

Expand All @@ -63,7 +63,12 @@ The weighted directed graph, :math:`G_d(V,E)`, is definied by:

* the set of edges :math:`E`

- :math:`E = \begin{cases} &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} &\quad \text{ if } reverse\_cost = \varnothing \\ \\ &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, reverse\_cost_i) \text{ when } reverse\_cost_i >=0)\} &\quad \text{ if } reverse\_cost \neq \varnothing \\ \end{cases}`
- :math:`E = \begin{cases}
\text{ } \{(source_i, target_i, cost_i) \text{ when } cost >=0 \} & \quad \text{if } reverse\_cost = \varnothing \\
\text{ } \text{ } & \quad \text{ } \\
\text{ } \{(source_i, target_i, cost_i) \text{ when } cost >=0 \} & \quad \text{ } \\
\cup \{(target_i, source_i, reverse\_cost_i) \text{ when } reverse\_cost_i>=0 \} & \quad \text{if } reverse\_cost \neq \varnothing \\
\end{cases}`



Expand All @@ -78,27 +83,39 @@ The weighted undirected graph, :math:`G_u(V,E)`, is definied by:

* the set of edges :math:`E`

- :math:`E = \begin{cases} &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, cost_i) \text{ when } cost >=0 \} &\quad \text{ if } reverse\_cost = \varnothing \\ \\ &\{(source_i, target_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, cost_i) \text{ when } cost >=0 \} \\ \cup &\{(target_i, source_i, reverse\_cost_i) \text{ when } reverse\_cost_i >=0)\} \\ \cup &\{(source_i, target_i, reverse\_cost_i) \text{ when } reverse\_cost_i >=0)\} &\quad \text{ if } reverse\_cost \neq \varnothing \\ \end{cases}`
- :math:`E = \begin{cases}
\text{ } \{(source_i, target_i, cost_i) \text{ when } cost >=0 \} & \quad \text{ } \\
\cup \{(target_i, source_i, cost_i) \text{ when } cost >=0 \} & \quad \text{ if } reverse\_cost = \varnothing \\
\text{ } \text{ } & \text{ } \\
\text{ } \{(source_i, target_i, cost_i) \text{ when } cost >=0 \} & \text{ } \\
\cup \{(target_i, source_i, cost_i) \text{ when } cost >=0 \} & \text{ } \\
\cup \{(target_i, source_i, reverse\_cost_i) \text{ when } reverse\_cost_i >=0)\} & \text{ } \\
\cup \{(source_i, target_i, reverse\_cost_i) \text{ when } reverse\_cost_i >=0)\} & \quad \text{ if } reverse\_cost \neq \varnothing \\
\end{cases}`



.. rubric:: The problem

Given:

- :math:`start_{vid} \in V` a starting vertex
- :math:`end_{vid} \in V` an ending vertex
- :math:`G(V,E) = \begin{cases} G_d(V,E) &\quad \text{ if } directed = true \\ G_u(V,E) &\quad \text{ if } directed = false \\ \end{cases}`
- :math:`start_{vid} \in V` a starting vertex
- :math:`end_{vid} \in V` an ending vertex
- :math:`G(V,E) = \begin{cases}
G_d(V,E) & \quad \text{ if6 } directed = true \\
G_u(V,E) & \quad \text{ if5 } directed = false \\
\end{cases}`

Then:

.. math:: \text{pgr_dijkstra}(sql, start_{vid}, end_{vid}, directed) =
.. math::`pgr_dijkstra(sql, start_{vid}, end_{vid}, directed) =
\begin{cases}
\text{shortest path } \boldsymbol{\pi} \text{ between } start_{vid} \text{and } end_{vid} &\quad \text{if } \exists \boldsymbol{\pi} \\
\varnothing &\quad \text{otherwise} \\
\end{cases}
\text{shortest path } \boldsymbol{\pi} \text{ between } start_{vid} \text{and } end_{vid} & \quad \text{if7 } \exists \boldsymbol{\pi} \\
\varnothing & \quad \text{otherwise} \\
\end{cases}`
:math:`\boldsymbol{\pi} = \{(path\_seq_i, node_i, edge_i, cost_i, agg\_cost_i)\}`
- :math:`\boldsymbol{\pi} = \{(path\_seq_i, node_i, edge_i, cost_i, agg\_cost_i)\}`

where:
- :math:`path\_seq_i = i`
Expand Down
4 changes: 2 additions & 2 deletions doc/dijkstra/pgr_dijkstra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Column Type Default Description
Additional Examples
--------------------------------------------------------------------------------------

The examples of this section are based on the :ref:`sampledata` network.
The examples of this section are based on the :doc:`sampledata` network.

The examples include combinations from starting vertices 2 and 11 to ending vertices 3 and 5 in a directed and
undirected graph with and with out reverse_cost.
Expand Down Expand Up @@ -324,7 +324,7 @@ See Also
-------------------------------------------------------------------------------

* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
* The queries use the :ref:`sampledata` network.
* The queries use the :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion doc/dijkstra/pgr_dijkstraCost.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ See Also
-------------------------------------------------------------------------------

* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
* :ref:`sampledata` network.
* :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion doc/dijkstra/pgr_dijkstraVia.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ See Also
-------------------------------------------------------------------------------

* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
* :ref:`sampledata` network.
* :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
2 changes: 1 addition & 1 deletion doc/driving_distance/pgr_drivingDistance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ See Also

* :ref:`pgr_alphashape` - Alpha shape computation
* :ref:`pgr_points_as_polygon` - Polygon around set of points
* :ref:`sampledata` network.
* :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
4 changes: 2 additions & 2 deletions doc/ksp/pgr_KSP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Column Type Description
**end_vid** ``BIGINT`` Identifier of the ending vertex.
**k** ``INTEGER`` The desiered number of paths.
**directed** ``BOOLEAN`` (optional). When ``false`` the graph is considered as Undirected. Default is ``true`` which considers the graph as Directed.
**heap_paths** ``BOOLEAN`` (optional). When ``true`` returns all the paths stored in the process heap. Default is ``false`` which only returns ``k`` pahts.
**heap_paths** ``BOOLEAN`` (optional). When ``true`` returns all the paths stored in the process heap. Default is ``false`` which only returns ``k`` paths.
============== ============ =================================================

Roughly, if the shortest path has ``N`` edges, the heap will contain about than ``N * k`` paths for small value of ``k`` and ``k > 1``.
Expand Down Expand Up @@ -173,7 +173,7 @@ See Also
-------------------------------------------------------------------------------

* http://en.wikipedia.org/wiki/K_shortest_path_routing
* :ref:`sampledata` network.
* :doc:`sampledata` network.

.. rubric:: Indices and tables

Expand Down
Loading

0 comments on commit 63b9cc1

Please sign in to comment.