Path finding: custom metrics of best path

Hello, everyone!

I have a question about Delta-Stepping Single-Source Shortest Path

GDS(path finding)

The point is, that I have

  • addresses of different types (some have no types)
  • relationships with timestamp

And i wanna detect all routes, leading from address type1 to address type(not 1)
Like
(address1{type:1}) - [first relation] -(address2{type:None}) - [last relation] - (address2{type:2})
And i wanna take the last relation and delete it
I tried gds.alpha.allShortestPaths.stream, but seems to me too unstable

So now i trying to apply gds.shortestPath.dijkstra
I choose different addresses of different types - 1 address by 1 type, and search all possible routes, where source.type <> target.type

And 2 problems here:

  1. I still don't get, how i can get at once routes for differnt types of addresses
    For example, i have a subquery like:

type | address
1 |address_1
2 |address_2

And i'd like to get output like

type | address. | target_type. | path
1 |address_1 | 2. | path from type1 to type2
2 |address_2| 3. | path from type2 to type3

But when i call the method it only takes one current source and computes routes only from it. Is there a way to do it?

  1. These methods search for a shortest path. But actually i need not the shortest path, but with the oldest relationship
    So if there are 2 paths from type1 to type2 (route1 and route2), I would like to calculate the maximum timestamp for route1 (max_ts_1) and maximum timestamp for route2 (max_ts_2), take the route with the smallest max_ts, and delete its last relationship

I would be happy to hear your thoughts and ideas about this problem.
Thank you in advance and hope this discussion could be interesting for others!

Can you post what cypher you have now so I can try to understand your data model and what you are trying to do? Also, what is wrong with the current query?

Um, sorry, you mean DB version?
4.4.10

What i'm trying to do...
Long story short, i have addresses and transactions
Transactions are connecting addresses, so we can see, which of the addresses are connected. I do it with the help of WCC

Problem:
Some of transactions connect addresses that can't be connected. So i call them bad transactions. And such connections can be built obviously:
(a1{type:1}) - [tx] - (a2{type:2})

Or by longer chains:
(a1{type:1}) - [tx] - (a3:{type:None}) - [tx] - (a2{type:2})

So i wanna cut minimum number of bad transaction, so that no types are overlapped

Also, what is wrong with the current query?

Well, i think I've already told, it's my Problem1 and Problem2 in the previous message

Please let me know, if you need more info or more detailed data

Hi @Alexx ,

I wanted to follow up and see if you were able to resolve this issue. If not, please provide the full Cypher Query and we can help you trouble shoot the problem.