Haha i had the same issue.
Me too, i did a mistake with the radians conversionā¦ and i searched for hours why only the fifth submit test fails!
Thanks for the tip
passed this with a* for the first time, coded in c++, got no problem in case 5 tho.
thereās a very familiar verson of this puzzle, called āDefibrillatorsā, in the easy puzzle, where you too have to calculate the distance of two points based on their lat and lon after converted from deg to rad, if anyone has done the puzzle they might not go through the radians to degrees mistake thingy
Weird, I had a seemingly wrong answer on #5 :
- ā¦
- Commerce
- Republique
- Pirmil
- ā¦
where the solution is supposed to be :
- ā¦
- Commerce
- Hotel Dieu
- Aime Delrue
- Vincent Gache
- Wattignies
- Mangin
- Pirmil
- ā¦
Couldnāt see any reason why my algo got the wrong result (radians OK, inverting lat/long doesnāt change anything,ā¦) so I submitted anyway and got 100%.
Not sure what to think about thisā¦
Edit : Oh cr*p ! Right after posting, I realized I forgot a condition in the update of cost and heuristic ! Now Iāve got the right result !
Iām having a weird issue possibly within the algorithm itself, and this is the first time Iāve implemented a Dijkstra (thanks codingame for giving me motivation on that). I canāt even pass all the IDE tests (stuck on test 05 -large number of stages-, the rest are ok) Comparing previous help on this thread, Iāve compared and made sure that Iāve used radians, implemented distance properly (and final distances match up with the ones listed here) except case 05 which is of 13.424056863059045
When debugging, Iām noticing that my code never finds a replacement path for existing nodes, which is weird. My current code is something like this: (pseudocode)
[redacted for obsoleteness; view post history]
solved: I had an incorrect implementation where I was looking at the wrong path in a specific edge case.
If anyone can point out if anything jumps out at them, please do share. Iāve been debugging this for two days now.
Hi All,
Just a short feedback. I had the same result as slava_spamec.
And I was sure to have a correct dijkstra, units in radians and no inversion in lat/lon.
After a few logs, I realized that none of my nodes had coordinates initialized at all. They all had 0/0 in lat/lon. What a stupid bug !!!
But even with that, I was still passing correctly all the test except #5 ā¦ dijkstra power
Of course, after correction, #5 passed like a charm.
To sum up, review carrefully your code, something very basic and stupid is hiding somewhere. And donāt really trust the fact that you passed test 1,2,3,4 and 6
Good luck ā¦
Thatās my problem!! Thanks!
Thanks, I also overlooked the degree/radian problem, and was wondering why only the validation did not run through ā¦
Hello,
There is a minor bug on the display of the description of the āTan Networkā puzzle: some html is displayed as text.
Kind regards
Hi,
Does anyone know how to get test cases for debugging outside of CG?
I cannot print more than ~100 lines of text in Console Output Window.
Ok, Problem solved (the hard way). Anyway, you can download test case 03 from here:
http://s000.tinyupload.com/?file_id=07139910495220821165
In the top right edge of the test cases, there are three lines. When you click them, you will see each test case input and output. Doesnāt work for round based puzzles, though.
Wow. Thanks a lot, I donāt know how I could have missed it
I really disliked this puzzle as it taught me only about anger management. I got Dijkstra right for the first time, but I missed
- converting from degrees to radians
- longitude and latitude order in input
also browsing the forum a typical mistake is - name is not unique (and I cannot think a reason to have two stops with the same name in a cityā¦).
Unfortunately these really donāt teach me anything other than you should spend more time reading badly designed inputs than solving a problem.
sorry, i have same issue with slava_spamec, canāt i ask is it right about test 5th which has a link linking the stop to itself, such as"stop a stop a". ?
Ok I finally beat the game at my 4th day working in that problem. Finally
Your answer got me on the right track.
I made a test case to be able to identify my problem. It helped me found was I was doing wrong In my code. So I put it here if someone need it.
Input:
StopArea:ABDU
StopArea:ACHA
3
StopArea:ABDU,āAbel Durandā,47.22019661,-1.60337553,1,
StopArea:ABLA,āAvenue Blancheā,47.22973509,-1.58937990,1,
StopArea:ACHA,āAngle Chaillouā,47.26979248,-1.57206627,1,
2
StopArea:ABDU StopArea:ABLA
StopArea:ABLA StopArea:ACHA
Output:
Abel Durand
Avenue Blanche
Angle Chaillou
My code was not working in this case because ACHA was never in the ālinksā list and when I checked his distance propriety my code throw an error because he didnāt exist.
Similar problem to: @slava_spamec, @Rafalon and @Unihedron, beside that I have no Gaston Veil stop. Iām getting following distances:
- 1.497307141189208
- 0.3348154821409763
- 0
- 2.3022053696674005
- 13.424056863058826
- inf
Stop list:
stops: 27 [āEINSā, āGERAā, āPCSIā, āRVREā, āRTSCā, āECSUā, āFACUā, āMORHā, āMICHā, āSFELā, āMOTEā, āSMHIā, āOTAGā, āCRQUā, āCOMMā, āRPBLā, āPIRMā, āPROUā, āMAI8ā, āBALIā, āMELIā, āXREZā, āMHUIā, āJGUEā, āJVALā, āLAILā, āGALHā]
endpoint: [āGalheurā, 13.424056863058826]
EINS ==> GALH
Einstein
Geraudiere
Petite Censive
Riviere
Recteur Schmitt
Ecole Centrale - Audencia
Facultes
Morrhonniere
Michelet
St-Felix
Motte Rouge
St-Mihiel
50 Otages
Place du Cirque
Commerce
Republique
Pirmil
Pont-Rousseau - Martyrs
8 Mai
Baliniere
Melies
Croix de Reze
Moulin a lāHuile
Jaguere
Jules Valles
Les Ailes
Galheur
It seems that algorithm goes in a wrong way. Que is sorted from the smallest distance. Looking forward for your remarks as I feel annoyed I cannot find the bug.
What is the point of the ā5 stops, 2 routesā validator? I could pass every other (ālarge numberā included) but not that one((
Iām clueless.
05 Large number of stages
Should go:
Einstein
Rene Cassin
but my algo goes:
Einstein
Geraudiere
which is strange, because GERA is closer:
[[0.3901467877398925, āGERAā], [0.41235770095082147, āRCASā]]
Any hint, where I made assumption mistake?
I liked this puzzle because it handles real data and problem. But I think there should be at least 2 more passing test:
- one to check that algorithm donāt take path in reverse B->A when there is only A->B,
- another to check distance are well calculated, i.e well converted in radians, with maybe data where two path that have almost the same distance.
Also there should be an example in statement of a distance calculation (with A(lat, lon) and B(lat, lon), distance is exactly N)
I get errors only on the large dataset test, and even the large dataset after submit, so it took me time to figure out what were the reasons.
Thanks to this thread it helped me.