Open Thomasb81 opened 9 months ago
After toying, reading and mumbling after the code I find this:
// TODO: It might be worth sorting connectors and routing them from
// smallest to largest estimated cost. This way we likely get
// better exclusive pin assignment during initial routing.
It is a known issue : the router is sensible to the order of processing connector. So changing the order connector are provided into router object produce different result.
Hello
On following example :
The testcase is represented by 4 shapes. The 2 left shape, are each connected to shape on the right. Each shape on the right have 2 connectorPin. Each connectorPin of each shape are registered with the same channel id and has the attribute exclusive set to true. In other words, the 2 connectorPin of each of the right shape are free to commute.
Since the router is configured with non null crossingPenalty, why the router does not look for the solution that consist to switch the 2 connectorPin on right bottom shape from current solution to remove 1 edge crossing ? By increasing the crossingPenalty the router end-up to choose a route that pass on the left of the left shape : that's not a solution I expect ...
It look like the astar algo is picking up the first available connectorPin as target without considering other option ...
If the router is able to identify the right connectorPin, it could minimize edge crossing. Consequently a drawing of the routing become simpler to understand.
For clarity, here is the result of the modified testcase for which connectionPin channel is chosen to force router to find the solution with only one edge crossing.
Is there a way to configure the router to make it chose the appropriate connectorPin to minimize edge crossing ? Is this behavior a bug or a limitation ?
Thanks
Here the code produce by outputInstanceToSVG: