These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

eve-route: a library & web-service for finding an optimized route

Author
Liu Ellens
Sebiestor Tribe
Minmatar Republic
#1 - 2014-02-01 22:33:15 UTC  |  Edited by: Liu Ellens
I extracted the path-finding algorithm from eve-upro and created a dedicated library for reuse in the browser or as a web-service.

The goal is to have the library be capable of finding optimized routes between two systems and a list of waypoints, using any form of travel available to capsuleers as well as a rich set of rules.

Here the hard facts:

  • JavaScript library
  • Available for Node.js as NPM package
  • Available for browsers (Bower info coming, for now as download from repository)
  • Open Source on GitHub


Features (planned or existing):

  • Utilizing any travel capability available: JumpGates, JumpDrive, JumpBridge, Wormholes, ...
  • Free combination of travel rules: TransitCount (= length), Min/Max Security (with fine-grained levels), jump distance, warp distance (for the extra speedy), kills, ...
  • Complex search criteria: Not just "Find way to this specific solar system".
  • Genetic algorithm for route finding - to produce reasonable results within short amount of time for many waypoints.
  • Extensible design - add your own travel rules, such as "Avoid systems of that alliance / faction."


eve-route - the web-service!
If the library is not enough, I packed it up into a web-service as well for example use and proof-of-concept.

  • Available on Heroku; see below for example JSON request
  • Open Source on GitHub


Note: Heroku stops unused runners after 1 hour. Startup takes a few seconds, so beware of that if you try it out. Furthermore, this is only a proof-of-concept service, used for demonstration.

Current Features (v.0.3.x)

  • Search Criteria: single system (per waypoint or destination); optional avoidance list (avoid Jita, ...)
  • Travel Capabilities: JumpGate, JumpDrive
  • Travel Rules: TransitCount, Min-Security, Max-Security, Jump-Distance
  • Extensible Design: Add your own capabilities/rules/... to the library through interface implementations (Most of the missing features will only implement the corresponding interfaces)


I wanted to create a first release to have the base framework out, then add features on the go and collect responses. The major version is 0, so far much can change.
(The entry on 3rdpartyeve.net will follow)

Why did I do this?
For one, the developer of eve-eye approached me to help regarding the routing algorithm. Second, I saw this as a reason to have something worthwhile out of eve-upro. And finally, it is a fun exercise to go back at my very first JavaScript code and re-imagine it with my current state-of-the-art knowledge and tools for JavaScript.

Example request
Use curl, http://www.hurl.it/ or something similar

See the JSON schemata for request and response bodies

  • Method: POST
  • Address: eve-route.herokuapp.com/route/find
  • Content-Type: application/json
  • Body:

application/json wrote:

{
"route": {
"from": {
"solarSystems": [30002553]
},
"to": {
"solarSystem": 30002575
}
},
"capabilities": {
"jumpGate": {}
},
"rules": {
"transitCount": {
"priority": 1
},
"minSecurity": {
"priority": 0,
"limit": 0.3
}
}
}

This requests a route from Bogelek to Sotrenzur, avoiding systems below 0.3 security - so it won't take the path through Katugumur in this instance.
Find further examples in the repository.

Well, they oughta know what to do with them hogs out there for shure.

Liu Ellens
Sebiestor Tribe
Minmatar Republic
#2 - 2014-02-01 22:33:27 UTC  |  Edited by: Liu Ellens
reserved



Note: Again I'm trying to follow the lean approach: I'll only continue this if there is reasonable interest (either from others or my fun in working on it ;)

Well, they oughta know what to do with them hogs out there for shure.

Seres Kashuken
Full Stack Capsuleers
#3 - 2014-02-05 08:05:49 UTC
Ooh, this looks quite useful! :D

Roid mining space hippie.

Amely Miles
Second Exile
#4 - 2014-02-06 16:34:51 UTC
i would like to see this as a java script i can use with this handy little program i found today called tampermonkey

As I slipped my finger slowly inside her hole, I could immediately feel it getting wetter and wetter.

I took my finger back out and within seconds she was going down on me.

"I really need a new boat," I thought to myself.

Liu Ellens
Sebiestor Tribe
Minmatar Republic
#5 - 2014-02-10 20:00:42 UTC  |  Edited by: Liu Ellens
v.0.2.0 released. This adds the functionality of avoiding solar systems in path finding, such as Jita (or Amamake, or any other you don't like ;).
Note: Although the badge on Github says the build is failing, it's all right - the build only fails because coveralls has some issues when deploying the coverage results.


The web service, also v.0.2.0, supports this as well with the new (optional) entry "avoid" in the route request. Here is an example:

application/json wrote:

{
"route": {
"from": {
"solarSystems": [30002509]
},
"to": {
"solarSystem": 30002526
},
"avoid": {
"solarSystems": [30002510]
}
},
"capabilities": {
"jumpGate": {}
}
}

This example searches for a path from Odatrik to Frarn, avoiding Rens. The resulting route will go via Abudban/Avesber as transit systems.


Also, Amely Miles, I don't quite understand what you mean - I found a tampermonkey as a Chrome plugin, are you referring to that? How should this be working together?

Well, they oughta know what to do with them hogs out there for shure.

Amely Miles
Second Exile
#6 - 2014-02-10 22:08:08 UTC
tampermonkey plugs in to chrome and stores java scripts and then uses the correct java script when you go to a website

As I slipped my finger slowly inside her hole, I could immediately feel it getting wetter and wetter.

I took my finger back out and within seconds she was going down on me.

"I really need a new boat," I thought to myself.

Liu Ellens
Sebiestor Tribe
Minmatar Republic
#7 - 2014-02-11 06:24:54 UTC
Amely Miles wrote:
tampermonkey plugs in to chrome and stores java scripts and then uses the correct java script when you go to a website

More precise, it's a userscript manager - and userscripts are some "...that make on-the-fly changes to web page content after or before the page is loaded in the browser" (Wikipedia).

eve-route.js is a library that is meant to be used within an application, most likely some sort of map-related application (such as eve-eye), it doesn't do anything by itself and is not related to web page content. But please describe your use-case how you would see them combined, so far I don't see that possible.

Well, they oughta know what to do with them hogs out there for shure.

Amely Miles
Second Exile
#8 - 2014-02-11 07:33:18 UTC
idiot proof is what i'm looking for .... i personaly love the idea but have no idea how to make it work

As I slipped my finger slowly inside her hole, I could immediately feel it getting wetter and wetter.

I took my finger back out and within seconds she was going down on me.

"I really need a new boat," I thought to myself.

Liu Ellens
Sebiestor Tribe
Minmatar Republic
#9 - 2014-02-22 16:51:44 UTC
The new released version v.0.3.1 includes support for jump drives!

The good news is the library now can mix and match various capabilities and rules for different effects.

In the following example, a route will be searched (for a Jump Freighter) from Jita to Tararan, which stays as long as possible in High-Sec to have the shortest possible jump into low-sec. (i.e.: Avoid low-sec as much as possible and have the shortest jump, saving on jump fuel)

application/json wrote:

{
"route": {
"from": {
"solarSystems": [30000142]
},
"to": {
"solarSystem": 30002979
}
},
"capabilities": {
"jumpGate": {},
"jumpDrive": {
"distanceLimit": 11.25
}
},
"rules": {
"jumpDistance": {
"priority": 1
},
"transitCount": {
"priority": 2
},
"minSecurity": {
"priority": 0,
"limit": 0.5
}
}
}

To read the "rules" entry: The rule with the highest priority (lowest number) is the one for the minimum security. Next comes the jump distance and finally the transit count.
Reordering the rules (or leaving them out) leads to different results, all depending on what you want to achieve.

The not so good news is that the calculation for the jump drives takes time and memory. As a result, I had to limit the possible distances for the test service on Heroku: It currently only supports jumps up to 5 light years. The startup time is still a bit long (about 1 minute). So, if the service was idle and you're not getting a response, give it another try after about two minutes.

There are a few options I am considering regarding this issue, all with pros and cons. It all depends on how the library or service would be used, so, feedback is welcome as always.

Well, they oughta know what to do with them hogs out there for shure.

Liu Ellens
Sebiestor Tribe
Minmatar Republic
#10 - 2014-03-15 21:11:18 UTC
Status update!
The performance hit was quite a deal-breaker for me so I reordered my priorities and scheduled my next step earlier: I wanted to learn Go and use this project to train it. With the demand for better performance, this became the second reason to port it.

During the last weeks I wrote a first prototype based on the design of eve-route.js - And performance data looks very promising! For instance, the complete thing with its jump data including jump drives uses only about 400MB in RAM (instead of ~2GB of the JS variant); Furthermore, the built-in capability to parallelize based on the concurrent algorithm makes the thing fly.

The code is available on GitHub here like the JS library, but is still more of a prototype (to be more precise: legacy code, because hardly any tests exist ;)
Even the corresponding webservice is missing as of yet, with this message I just wanted to give an update on where the whole project stands.

The future of eve-route.js is undecided. I figured it's still a viable library, just jump drives are not nice.

Also, rewriting the same design in a different language was very interesting; Although I could follow the design in most parts, I found some areas for refinement as well as design issues; Go is very pedantic about dependency cycles for instance (and rightly so).

Well, they oughta know what to do with them hogs out there for shure.