exodus4d / pathfinder

Mapping tool for EVE ONLINE
https://www.pathfinder-w.space
MIT License
383 stars 250 forks source link

Routes ignorring some Jumpbriges #949

Open NormannK opened 4 years ago

NormannK commented 4 years ago

We made a map with all JB's we have access too. Sadly the routes tool is ignoring some of them. jb

Example: IGE-RI to 1DQ1-A should use the B1O- Jb to G95 go to c-n and further. Instead the suggestions is to travel by Gates to C-N (+5 Jumps). IGE-RI to Jita should use the OW- JB (1 jump from IGE) but its going to c-n and taking the jb there That route is 7 jumps longer.

When selecting B17O the Jb there is ignored too. We are only using this map and no Thera connections. I hope you understand what I'm trying to say. Thanks

CalMatar commented 4 years ago

Does it use some jump bridge connections and not others or is it not using any jump bridge connections at all?

NormannK commented 4 years ago

As you can see on the screenshot, its ignoring some connections. Others are used.

exodus4d commented 4 years ago

Without going deeper into the code for an investigation, I think this is the problem: https://github.com/exodus4d/pathfinder/blob/62dc991760e3d0bfde078affde20a3fcc6ed2360/app/Controller/Api/Rest/Route.php#L24-L28

This is a hard-coded max limit for custom connections, that will be send to ESIs route search. On https://esi.evetech.net/ui/#/Routes/get_route_origin_destination there is no information about the max limit of custom connections. At the time of implementing the endpoint, I got errors from CCPs ESI endpoint because of that. 50 connections (WHs + jumpbridges) is easy to reach when you select multiple maps in the "route search" dialog. Pathfinder just adds relevant custom connections, until the limit is reached (and we would get an error response). I will check if the limit still exists, maybe it is increased in the meantime.

exodus4d commented 4 years ago

In your case (just by counting the jump bridges), there are 60 connections. 10 of them will be "ignored". If you add more custom wh-connections, the number of JB send to ESI will be reduced further more.

exodus4d commented 4 years ago

What I can do is some kind of "priority":

NormannK commented 4 years ago

how about the fall back to the custom route search if there are too many connections? https://github.com/pvyParts/pathfinder/commit/174669385056db55a198733a2e9eea9fcf5ac942

pvyParts commented 4 years ago

the limit does still exist before hacking up that change i just pushed the number out to 200.

ESI threw the too many connections error and then the internal router was run.

exodus4d commented 4 years ago

OK, if the limit still exists, and my "fallback" route function does not find a route, then increase this: https://github.com/exodus4d/pathfinder/blob/62dc991760e3d0bfde078affde20a3fcc6ed2360/app/pathfinder.ini#L192-L200

This defines "how many" connections are checked to find a route before "giving up" and no route found. So this is not equal with the "jump" distance (shortest route). If you have "too many" new "entry" points for the algorithm, the limit can be hit. This makes sense because Jumpbridges usually have a greater distance than stargates (1 jump). Same, if you are in a complex wormhole-chain that has exists across New-Eden. How it works: DijkstraDemo

Under "normal" conditions 9000 should be fine. Watch your CPU usage, this is an intense calculation. I can not increase this on my public installation, there are too many route search requests coming in per second.

more to read: #131 search algorithm: Dijkstra's algorithm

NormannK commented 4 years ago

the Dijkstra's algorithm is really good! But it only worked after the change i linked before from @pvyParts . Unbenannt

exodus4d commented 4 years ago

OK, I re-tagged the issue as "enhancement", and I´ll check @pvyParts changed and add them if it works.