import pants
import math
nodes = []
waypoints = {"Egnaix XJ-Z e30": (6005.9375, 22287.1875),
"Mynoaw NY-K b37-55": (4690.6875, 18940.34375),
"Eeshorks SD-B d3065": (1562.34375, 16905.5),
"Greae Phio LS-L c23-797": (1354.03125, 16593.125),
"Boepp XA-D d13-1042": (-446.53125, 16697.59375),
"Boepp UE-Q e5-2104": (-550.03125, 16610.34375),
"Iowhail WY-S e3-8736": (-1649.5625, 16333.875),
"Froarks XJ-R e4-1363": (-481.8125, 15101.1875),
"Froarks JH-T d4-353": (-400.40625, 14710.9375),
"Blae Hypue NH-V e2-9": (1196.40625, 12301.65625),
"Clookuia AR-U c16-2": (2915.09375, 12491),
"Circinus Pulsar": (10852.09375, 13081),
"Phrooe Flyuae QE-Y d1-44": (17916.40625, 23444.875),
"Pueliae SH-P c20-0": (18017.8125, 13897.28125),
"Rhadia AA-A h59": (21392.21875, 12392.8125),
"Blie Aewsy IX-A d1-2": (19631.6875, 11883.34375),
"Thailau AA-A h49": (18597.28125, 4859.375),
"NGC 3199 Sector KX-T b3-0": (14574.15625, 3511.90625),
"Eta Carina Sector JM-W d1-1": (8561.71875, 2714.40625),
"CD-41 4893": (8157.03125, -599.03125),
"Skull and Crossbones Neb. Sector FG-Y e6": (13384.3125, -6763.71875),
"NGC 2244 CDZ 132": (2400.59375, -4834.71875),
"Rosette Sector GW-W d1-97": (2345.21875, -4741.25),
"GCRV 4925": (661.46875, -4084.0625),
"Monkey Head Sector QD-S b4-0": (1135.09375, -6296.5625),
"Crab Pulsar": (558.5, -6941.75),
"NGC 1931 Sector HW-W c1-13": (-742.8125, -6960.78125),
"BD+50 886": (-4907.96875, -8711.21875),
"Soul Sector LC-V c2-16": (-5099.3125, -5497.8125),
"Heart Sector NS-T b3-1": (-5319.25, -5287.15625),
"2MASS J02351897+6131236": (-4192.71875, -4190.625),
"BD+55 191": (-6660.25, -4345.59375),
"Bubble Sector PD-S b4-4": (-6570.5, -2680.28125),
"S171 29": (-2443.5625, -1333.5),
"Cave Sector FB-X c1-5": (-2244.84375, -825.78125),
"SHB2004 Trumpler 37 12-2113": (-2657.4375, -431.25),
"BD+66 1066": (-2842.375, -323.875),
"Cocoon Sector EL-Y d19": (-3175.21875, -244.96875),
"Crescent Sector GW-W c1-8": (-4842.1875, 1252.21875),
"V1357 Cygni": (-7095.375, 2396.8125),
"North America Sector GC-K a9-1": (-1891.03125, 149.65625),
"Veil East Sector DL-Y d54": (-1916.34375, 490.375),
"BD+22 3878": (-958.21875, 535.5),
"HIP 14769": (-330.96875, -481.28125),
"HIP 17403": (-93.6875, -367.625),
"Maia": (-81.78125, -343.375),
"Aries Dark Region GW-W d1-34": (-56.0625, -247.1875),
"Nervi": (-74.75, 35.84375),
"Epsilon Indi": (3.125, 7.125),
"Pomeche": (56.65625, 3.09375),
"HIP 31384": (513.09375, -439.8125),
"Witch Head Sector DL-Y d22": (378.21875, -722.90625),
"BD-12 1172": (577.875, -819.25),
"The Veil": (593.3125, -1071.125),
"Trapezium Sector CB-W c2-3": (538.53125, -1139.25),
"Trapezium Sector AF-Z c5": (625.75, -1198.53125),
"Trapezium Sector XO-Y b1-0": (619.75, -1224.3125),
"Trapezium Sector AF-Z c0": (617.03125, -1224.5625),
"Orion Dark Region KC-V c2-0": (603.3125, -1337.6875),
"HD 49368": (757.46875, -1424.375),
"Cone Sector GW-W c1-5": (854.71875, -2025.75),
"R Monocerotis": (1210.3125, -2744.1875),
"HIP 38064": (1152.9375, -478.25),
"Vela Dark Region LC-V c2-29": (991.0625, -48.96875),
"HIP 41908": (843.9375, -108.375),
"Chamaeleon Sector PD-S b4-2": (482.875, 307.90625),
"Musca Dark Region ZB-I a11-0": (425.90625, 267.5),
"Corona Austr. Dark Region PD-S b4-3": (-9.4375, 490.1875),
"Ophiuchus Dark Region B Sector PD-S b4-2": (-44.40625, 487.625),
"IC 4604 Sector FB-X c1-19": (64.03125, 565.65625),
"HD 148937": (548.6875, 1274.71875),
"NGC 6188 Sector HW-W c1-11": (1705.75, 4054),
"Cat's Paw Sector PD-S b4-7": (852, 5426.75),
"Thor's Eye": (-439.84375, 4205.15625),
"Herschel 36": (-468, 4474.625),
"Trifid Sector DH-K a9-6": (-637.65625, 5161.90625),
"PW2010 210": (-1337.9375, 5305.6875),
"Omega Sector PD-S b4-0": (-1432.0625, 5308.125),
"Gria Drye OC-B d1-211": (-1451.65625, 5435),
"Eagle Sector PD-S b4-5": (-2046.75, 6689.28125),
"Cl Pismis 16": (965.1875, 8094.40625),
"Prieluia GH-B c27-16": (899.59375, 9060.8125),
"Plaa Ain KS-A b2-5": (869.5625, 9219.5),
"Pru Aescs UO-V b30-7": (-3170.625, 8561.28125),
"Flyiedge RW-W d1-4": (-4102.125, 8064.6875),
"Flyiedgai MX-E c26-10": (-6369.15625, 9035.65625),
"Ellaisms QX-U e2-43": (-5469.9375, 9673.84375),
"Skaude AL-X e1-28": (-4708.625, 9571.75),
"Skaude AA-A h216": (-4804.59375, 10127.65625),
"Skaudai LC-V f2-10": (-5398.25, 10401.65625),
"Prua Phoe TS-B d126": (-5539.65625, 10481.15625),
"Xeehia GT-G d11-8": (-4793.84375, 11421.46875),
"Crookaae DL-Y g18": (-3935.5, 12387.46875),
"Clookia NK-M d8-431": (-3745.8125, 12472.125),
"Blaa Phoe NC-D d12-230": (-5377.90625, 15398),
"Blaa Phoe JX-T e3-26": (-5899.96875, 15074.65625),
"Blua Hypa HT-F d12-1226": (-7010.28125, 12817.625),
"Eor Aoscs AA-A h256": (-7296.34375, 17427.9375),
"Dryoea Flyuae AA-A g392": (-7698.09375, 18141.3125),
"Dryooe Flyou YT-A e1844": (-9191.59375, 18282.125),
"Spoihaae XE-X d2-9": (-9346.125, 19659.0625),
"Colonia": (-9530.5, 19808.125),
"Rodentia": (-9530.53125, 19787.375),
"Spoihaae EW-V e2-670": (-9526.96875, 19910.96875),
"Dryooe Prou FF-Z d696": (-9378.28125, 20786.59375),
"Dryooe Prou HH-C d267": (-9875.8125, 20760.25),
"Screake SJ-Y d1-265": (-9955.75, 20872.71875),
"Oephaif GE-E b1-10": (-10807.4375, 16889.3125),
"Grea Hypooe ZZ-O d6-19": (-11952.75, 13590.53125),
"Ellaid AA-A h5": (-9506.8125, 9935.0625),
"Zejoo WM-Q b52-2": (-15778.1875, 11586.21875),
"Dehoae FL-W d2-0": (-15796.75, 9459.46875),
"Bloo Dryue ND-I d10-19": (-17091.5, 4942.25),
"Eullobs EL-Y e7": (-18821.375, 4326.96875),
"Fraufooe AA-A h8": (-25665.65625, 1732.34375),
"Byooe Thio AA-A g1": (-25253.0625, 3364.34375),
"Ovomly PD-R d5-3": (-19778.21875, 7113.1875),
"Thraikoo PS-U e2-4": (-18646, 7135.9375),
"Crooki PX-V c17-5": (-23057.3125, 12528.84375),
"Grea Hypae WU-O e6-4": (-19434.09375, 14144.78125),
"Floasly TE-X d2-25": (-17387.15625, 14558),
"Floagh FI-B d13-1": (-20463.84375, 15481.1875),
"Screakoi WO-G c11-1": (-22379.4375, 21178.1875),
"Hypoea Flyiae CW-V e2-0": (-26612, 22475.34375),
"Pha Flaae HT-H d10-56": (-22980.9375, 24145.34375),
"Dryu Chraea FH-D d12-49": (-23799.71875, 29480.125),
"Eol Groa UG-K d9-89": (-20477.21875, 30527.28125),
"Eolls Graae PG-E b15-4": (-18874.84375, 29977.375),
"Juemeou GN-S e4-18": (-19204.5, 26659.84375),
"Phooe Auf HV-I c24-0": (-15057.25, 26889.65625),
"Guenae SB-I b57-0": (-14382.6875, 27041),
"Pyroomeou GE-C c28-0": (-15793.3125, 25757.375),
"Phreia Flyou JT-P b22-2": (-15357.0625, 23746.90625),
"Phooe Aob OU-V b7-0": (-14739.96875, 23417.65625),
"Phreia Flyou FG-V d3-116": (-14327, 23596.875),
"Phreia Flyou UB-A b32-0": (-14503.84375, 23947.90625),
"Juenoe EG-Y g1913": (-8931.1875, 26846.46875),
"Eord Gree UU-X e1-1268": (-7631.8125, 30067.40625),
"Eimbaisys JC-V e2-352": (-4968, 30248.8125),
"Pha Scroi GS-I d10-64": (-9453.84375, 24186.96875),
"Dryee Free IM-W e1-14": (-7705.03125, 21086.6875),
"Screakou EW-N e6-5997": (-5743.78125, 21914.25),
"Scheau Flyi GH-U e3-3617": (-5783.40625, 22683.90625),
"Wepooe AA-A h509": (-4809.34375, 24133),
"Dumbaa XJ-R e4-5596": (-4252.625, 22780.84375),
"Theau Pri FB-W e2-25": (-3979.625, 20042.75),
"Dryaa Pruae GG-Y e5180": (-2197.53125, 20979.34375),
"Dryau Ausms KG-Y e3390": (-1523.75, 20976.59375),
"Leamuae SI-T e3-4236": (945.28125, 20129.25),
"Shrogea MH-V e2-1763": (971.03125, 21307.3125),
"Dumbae SY-I d9-2339": (-542.71875, 22837.96875),
"Hypuae Audst OF-E d12-978": (-26.125, 25627.53125),
"Croomaa RD-A d14-1524": (-79.6875, 25810.375),
"Juenae OX-U e2-8852": (652.46875, 26400.375),
"Eok Bluae MU-V c16-2452": (292.46875, 27839.71875),
"Eok Gree TO-Q e5-3167": (-1502.9375, 30671.1875),
"Iwhaind AA-A g1771": (-3602.40625, 32338.25),
"Scheau Byoe XJ-P d6-1080": (-5380.5, 35360.09375),
"Hypiae Briae KM-W d1-2603": (-6270.125, 34975.375),
"Hypiae Briae FR-N e6-3007": (-5975.3125, 36014.90625),
"Vegnue VK-E d12-1019": (-5684.34375, 37168.5),
"Gooreia WO-Z e131": (-5436.84375, 38817.3125),
"Plaa Free XE-R d4-382": (-2331.1875, 40333.71875),
"Dryiquae OI-B d13-0": (-4353.15625, 41088.4375),
"Bleethue KR-A b15-0": (-7171.15625, 37657.8125),
"Phroea Gree PU-D d13-3163": (-6833.40625, 37191.21875),
"Teqo EB-V c16-5": (-8294.625, 36797.53125),
"Vegnae YE-R e4-121": (-10916.96875, 36858.625),
"Vegneia BF-R e4-735": (-11623.40625, 36943.6875),
"Greethia SS-U e2-48": (-11818.75, 37864.3125),
"Myoangooe KD-S e4-2": (-11535.96875, 42045.90625),
"Myoangooe AA-A h1": (-11484.4375, 42231.96875),
"Trignai MT-Q e5-28": (-16355.875, 40895.34375),
"Eactaisky IR-N e6-2": (-19483.84375, 43610.375),
"Flyoo Groa SO-Z e0": (-26482.4375, 50335.125),
"Eufarb UT-Z d13-37": (-20650.3125, 53916.8125),
"Bya Freau SO-Z d13-5": (-9463.53125, 47512.46875),
"Pyriviae NY-Y d1-66": (-11166.9375, 54191.125),
"Truecha ZK-P e5-25": (-7584.78125, 53765.46875),
"Greae Bluae YE-A g3": (-5905.03125, 54076),
"Pyriveae FK-C d14-72": (-1235.5625, 55221.65625),
"Pyrivo HW-V e2-8": (-1498.25, 54503),
"Thuecheae MT-Q e5-8": (-2270.5, 53714.3125),
"Tyroerts AA-A g2": (-2085.75, 50391.0625),
"Byeia Free WR-W b56-0": (-1821.96875, 47520.34375),
"Striechooe HO-D c14-2": (-709.40625, 48207.5),
"Smootoae VE-R d4-134": (38.96875, 51819.53125),
"Drooteou PW-I a36-4": (51.5625, 51800.53125),
"Preae Chruia AA-A h0": (2647.5625, 49355),
"Auphails AA-A h45": (2605.21875, 50753.625),
"Qauthoea WM-W d1-40": (3668.21875, 55440.625),
"Cheia Eoq TJ-U b22-0": (11402.09375, 58302.875),
"Eictach ES-I d10-3": (8299.75, 60046.9375),
"Ooctarbs CP-E c25-1": (11459.53125, 60177.4375),
"Qauthe ON-B d13-2": (17571.5, 56444.375),
"Byoo Chraei AA-A f0": (16586.625, 54280.4375),
"Hyiechou AI-J b36-0": (20185.46875, 48362.71875),
"Grie Prao LH-E b59-1": (21885.3125, 47567.75),
"Prai Pruae CL-Y g0": (17879.09375, 42374.53125),
"Flyai Flyuae XJ-A c2": (17926.28125, 37360.59375),
"Bleethuia FF-A e1": (17817.40625, 37388.84375),
"Flimbuae GY-P d6-7": (18057.875, 27718.15625),
"Flimbuae CA-A e2": (18265.09375, 27124.125),
"Eock Bluae TW-V c2-0": (16058.75, 27219.8125),
"Cloomaa YE-R e4-113": (9578.8125, 25449.125),
"Pheia Auscs AL-T c5-155": (8340.25, 26071.59375),
"Eorm Phyloi OY-Z d37": (6548.3125, 27246.28125),
"Umbaists XJ-A e6237": (5231.59375, 29802.03125),
"Smasiae QT-Q d5-70": (4260.0625, 32717.5),
"Dryio Blue LJ-X d2-629": (3920.5625, 28683.6875),
"Eord Bla HW-W f1-611": (3621.59375, 27999.34375),
"Sluenoe CL-Y g4": (5168.4375, 26556.09375),
"Dryaa Prao PJ-G d11-89": (8361.90625, 21723.28125),
"Hyphokooe AA-A h62": (-10969.90625, 44395.5),
"Cyoidai GH-U e3-3": (663.1875, -6773.4375 ),
"2MASS J02351897+6131236" : (-4192.71875, -4190.625 ),
"Veil West Sector DL-Y d68": (-1398.25, 418.90625 ),
"Egnaix GW-V e2-0": (6124.28125, 22529.3125)}
for key, value in waypoints.items():
nodes.append(value)
def euclidean(a, b):
return math.sqrt(pow(a[1] - b[1], 2) + pow(a[0] - b[0], 2))
world = pants.World(nodes, euclidean)
solver = pants.Solver(alpha=1.61,beta=14,rho=0.9,limit=30000,ant_count=128,Q=4)
solutions = solver.solutions(world)
j = 0
best = float("inf")
for solution in solutions:
j += 1
assert solution.distance < best
best = solution.distance
pilgrimage = []
for i in solution.tour:
pilgrimage.append(list(waypoints.keys())
[list(waypoints.values()).index(i)])
for i in pilgrimage:
print(i)
print("===========================================================")
print(j,": ", best)
print("===========================================================")