Ticket #15 (closed bug report: fixed)

Opened 3 years ago

Last modified 3 years ago

No shortest path of edges with same source and target node

Reported by: daniel Owned by: anton
Priority: major Milestone:
Component: A* Version: 1.0.0a
Keywords: Cc:

Description

Node based shortest path algorithms (Dijkstra, A*) cannot distinguish between two edges, that have same source and same target (parallel edges). Randomly one of those edges will be selected for the route (see attached screenshot).

To be able to use node based algorithms, two nodes may not have the same source and target. How can this be taken into account? How to verify (and correct) those edges, when creating the network topology?

Attachments

ssp_parallel_nodes_bug.png Download (103.0 KB) - added by daniel 3 years ago.
split_parallel_edges.sql Download (3.2 KB) - added by anton 3 years ago.

Change History

Changed 3 years ago by daniel

  Changed 3 years ago by anton

  • owner changed from somebody to anton
  • status changed from new to assigned

in reply to: ↑ description ; follow-up: ↓ 3   Changed 3 years ago by jonnio

Replying to daniel:

Node based shortest path algorithms (Dijkstra, A*) cannot distinguish between two edges, that have same source and same target (parallel edges). Randomly one of those edges will be selected for the route (see attached screenshot). To be able to use node based algorithms, two nodes may not have the same source and target. How can this be taken into account? How to verify (and correct) those edges, when creating the network topology?

Even if there is more than one path from node to node, there can only be one 'lowest cost' method. There might need to be a procedure to clean up your dataset and remove all but the lowest cost edge.

in reply to: ↑ 2   Changed 3 years ago by anton

  • priority changed from critical to major

Replying to jonnio:

Replying to daniel:

Node based shortest path algorithms (Dijkstra, A*) cannot distinguish between two edges, that have same source and same target (parallel edges). Randomly one of those edges will be selected for the route (see attached screenshot). To be able to use node based algorithms, two nodes may not have the same source and target. How can this be taken into account? How to verify (and correct) those edges, when creating the network topology?

Even if there is more than one path from node to node, there can only be one 'lowest cost' method. There might need to be a procedure to clean up your dataset and remove all but the lowest cost edge.

Yes, I agree - there shouldn't be parallel edges. But we just cannot remove any edge - what if somebody will want to calculate a shortest path from/to those edge? I think we need to split them somehow at the topology creation stage.

Changed 3 years ago by anton

  Changed 3 years ago by anton

  • status changed from assigned to closed
  • resolution set to fixed

See split_parallel_edges.sql (attached) for a sample function which splits parallel edges.

Note: See TracTickets for help on using tickets.