Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dijkstra crashes if a cost is negative #3

Closed
antonpa opened this issue Nov 15, 2010 · 1 comment
Closed

Dijkstra crashes if a cost is negative #3

antonpa opened this issue Nov 15, 2010 · 1 comment
Milestone

Comments

@antonpa
Copy link
Contributor

antonpa commented Nov 15, 2010

According to the documentation :

  • cost: double precision value of the edge traversal cost. (a negative cost
    will prevent the edge from being inserted in the graph).

Yet when I have a negative cost (-1) to forbid using an edge it seems to crash (I don't know what really happens :

testdb=# SELECT * FROM shortest_path('SELECT edge_id AS id, source_id::int4 as source, target_id::int4 as target, cost::double precision AS cost FROM streets_topology',18342, 49625, false, false);
server closed the connection unexpectedly

This probably means the server terminated abnormally
before or while processing the request.

The connection to the server was lost. Attempting reset: Failed.
If I set the cost to a high value, or 'Infinity' it works correctly.

I suppose that the algorithm considers that the edge exists and has a negative cost (which is a problem with Dijkstra).

@woodbri
Copy link
Contributor

woodbri commented Mar 28, 2013

SHA: 561c7e7 fixes this issue in branch sew-devel-2_0

@dkastl dkastl modified the milestone: Release 1.x Mar 23, 2015
@dkastl dkastl removed the 1.x label Mar 23, 2015
cvvergara added a commit that referenced this issue Jan 15, 2016
cvvergara pushed a commit that referenced this issue Jan 23, 2016
added -U user to pg_prove tests
cvvergara pushed a commit that referenced this issue Mar 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants