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 throwing exceptions in some cases #7869

Closed
agarciaGIT opened this issue Nov 4, 2017 · 3 comments
Closed

dijkstra throwing exceptions in some cases #7869

agarciaGIT opened this issue Nov 4, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@agarciaGIT
Copy link

OrientDB Version: 2.2.29

Java Version: 1.8.0_111

OS: Amazon Linux AMI 2016.09

Expected behavior

Running dijkstra will return the cheapest path between two vertices

Actual behavior

Exceptions are thrown in certain cases

Steps to reproduce

I have a graph where I added the Property 'weight' to E. I created other Sub classes from E and V. If I run shortestPath I get a response. If I run dijkstra on the same source and destination I get an exception.

orientdb {db=SpinOffIntelligence}> select shortestPath(#30:5,#39:3,'BOTH')

+----+---------------------+
|# |shortestPath |
+----+---------------------+
|0 |[#30:5,#13:780,#39:3]|
+----+---------------------+

1 item(s) found. Query executed in 0.002 sec(s).
orientdb {db=SpinOffIntelligence}> select dijkstra(#30:5,#39:3,'weight','BOTH')

Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Error on execution of command: sql.select dijkstra(#30:5,#39:3,'weight','BOTH')
DB name="SpinOffIntelligence"
DB name="SpinOffIntelligence"

Running dijkstra with other Vertices does work some time. I can't tell why.

orientdb {db=SpinOffIntelligence}> select dijkstra(#30:5,#39:5,'weight','BOTH')

+----+-------------------------+
|# |dijkstra |
+----+-------------------------+
|0 |[#30:5,#31:0,#16:6,#39:5]|
+----+-------------------------+

@agarciaGIT
Copy link
Author

@luigidellaquila
Copy link
Member

HI @agarciaGIT

you have a broken DB, some edges point to non-existing vertices.
In my instance I found this edge

+----+-------+--------+-----+--------+------+----------------+
|# |@Rid |@Class |out |in |weight|type |
+----+-------+--------+-----+--------+------+----------------+
|0 |#20:129|EPartner|#39:6|#19:1798|1 |Research Partner|
+----+-------+--------+-----+--------+------+----------------+

(I don't know if the RID matches, during the import it can change) that points to #19:1798 vertex, that doesn't exist.

I'm adding some checks to dijkstra() function to prevent exceptions, but the real problem here is not in the implementation

Thanks

Luigi

@agarciaGIT
Copy link
Author

agarciaGIT commented Nov 6, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants