mage icon indicating copy to clipboard operation
mage copied to clipboard

error when calling tsp.solve()

Open AnBjCru opened this issue 10 months ago • 4 comments

Hi, I am not sure if this is a bug or if I am doing something wrong, which is why I am opening it as a blank issue.

When I call tsp.solve() I get the following error message:

tsp.solve: Traceback (most recent call last): File "/usr/lib/memgraph/query_modules/tsp.py", line 44, in solve dm = create_distance_matrix([dict(x.properties.items()) for x in points]) File "/usr/lib/memgraph/query_modules/tsp.py", line 44, in dm = create_distance_matrix([dict(x.properties.items()) for x in points]) File "/usr/lib/memgraph/python_support/mgp.py", line 299, in items prop = properties_it.next() _mgp.LogicErrorError: Logic error.

I've gone through the documentation for tsp and the code all the way down to 'mgp.py'. My nodes have propertioes 'lng' and 'lat' but as far as i can see there is something wrong when the code is iterating the node to find these properties.

The logfile says following:

[2025-03-14 15:56:51.737] [memgraph_log] [error] Logic error during mg API call: mgp_value for PropertyValue::Type::Point2d doesn't exist. Contact Memgraph team under [email protected] or open a new issue / comment under existing one under github.com/memgraph/memgraph. [2025-03-14 15:56:51.737] [memgraph_log] [trace] Error message: tsp.solve: Traceback (most recent call last): File "/usr/lib/memgraph/query_modules/tsp.py", line 44, in solve dm = create_distance_matrix([dict(x.properties.items()) for x in points]) File "/usr/lib/memgraph/query_modules/tsp.py", line 44, in dm = create_distance_matrix([dict(x.properties.items()) for x in points]) File "/usr/lib/memgraph/python_support/mgp.py", line 299, in items prop = properties_it.next() _mgp.LogicErrorError: Logic error.

The query: MATCH (n:NO_RoadNode) WHERE n.nodeid >= 1769300 AND n.nodeid <= 1769305 WITH COLLECT(n) AS nodes CALL tsp.solve(nodes) YIELD sources, destinations RETURN sources, destinations;

I run Memgraph 3.0 in Docker on Windows.

Please tell me if you need more information./Thank you

AnBjCru avatar Mar 17 '25 11:03 AnBjCru

Hi @AnBjCru, it looks like some iteration problem; we will take a look; thanks for reporting this.

Does this block you massively? What are you trying to build?

antejavor avatar Mar 17 '25 12:03 antejavor

Does this block you massively? What are you trying to build? We want to evaluate it for coming proposal to a customer.

AnBjCru avatar Mar 17 '25 12:03 AnBjCru

Hi @AnBjCru, I think it's best you book an office hours call with us so we can further understand your needs and help you accelerate your proposal - https://memgraph.com/office-hours

katarinasupe avatar Mar 19 '25 07:03 katarinasupe

Quick update for anyone tackling this in the future - after the Office Hours call, the user shared a dataset and detailed steps to replicate the issue in an email thread.

matea16 avatar Mar 25 '25 14:03 matea16