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.
 

Solar systems X jumps away from current system

First post
Author
Diego DelTorros
Dire Wolf Armoury
#1 - 2016-01-22 15:48:36 UTC
Hello fellow capsuleers.

Right now I'm learning some ruby on rails and what could be better, that to try and build an EVE application.

Is there a possibility with CREST or using any other service to retrieve all systems which are around the current system? (Around - meaning X jumps away from the requested current system)

Let's say I want to find out which systems are within 1 jump reach of Amarr. The function should return Sarum Pride, Ashab, Bhizeba and Hedion.

I've actually got this working so far by using eve-central.com api - https://eve-central.com/home/develop.html (the route function).

However this seems a little bit overcomplicated (for each system I'm looping through ALL other systems and calculate how many jumps there are via the http://api.eve-central.com/api/route/from/Jita/to/V2-VC2 endpoint).

Maybe there is an easier way and I can't figure it out?

http://eve-trader.net - small web application for industrialist. Calculate your profits on blueprints in real time.

CCP Tellus
C C P
C C P Alliance
#2 - 2016-01-22 15:59:08 UTC
The SDE has an SQLite database with the table mapSolarSystemJumps. That table lists stargate connections between solar systems.
Princess Honneamise
#3 - 2016-01-22 18:28:23 UTC  |  Edited by: Princess Honneamise
Yes, use the SDE and then use an algorithm like BFS .

/*
1 procedure BFS(G,v) is
2 create a queue Q
3 create a set V
4 enqueue v onto Q
5 add v to V
6 while Q is not empty loop

7 t ← Q.dequeue()
8 if t is what we are looking for then
9 return t
10 end if
11 for all edges e in G.adjacentEdges(t) loop
12 u ← G.adjacentVertex(t,e)
13 if u is not in V then
14 add u to V
15 enqueue u onto Q
16 end if
17 end loop
18 end loop
19 return none
20 end BFS
*/

each nodes must have a variable "distance" assigned=0 at the beginning;

than you can after line 12 :
u.distance = t.distance+1;

and the if condition in line 13 must be :

if u is not in V AND u.distance <= the_hell_i_want then



EDIT : of course you dont have to return t but the entire list V so you have to skip line 8 and 9 .

EVE MOONS PROJECT

http://eve-moons.com

The EVE MOONS PROJECT is the most complete and accurate moons database for Eve Online

Louis Vitton
Viziam
Amarr Empire
#4 - 2016-01-22 19:31:17 UTC
This may help you get the idea also - https://github.com/fuzzysteve/eve-routetools
Diego DelTorros
Dire Wolf Armoury
#5 - 2016-01-22 20:02:06 UTC
Wow, thanks a lot for the suggestions. I'll try to dig deep into that algorithm :)

http://eve-trader.net - small web application for industrialist. Calculate your profits on blueprints in real time.