Death First Search - Episode 1 - Puzzle discussion

I had this same problem and I think what’s happening is the JavaScript code just crashes in the validation test but not in the test cases. In my case I suspect it was because I had an undefined value returned and didn’t have a valid node to sever. I just improved my error checking and made sure I couldn’t issue an illegal sever and I got the 100%.

I just left 50 links but i couldn’t get bonus.

2 Likes

It’s because the test that is used to rate your program when you send it is slightly different from the one you used to check your program.
Otherwise, people would cheat.

1 Like

Well I finally got a 50+ on the final test. Problem first was that I didn’t count with the node indexes were so much shuffled. There is no nice 0- 17 or something anymore.
You can enable the index numbers in the final validation by clicking the setting wheel and choose debug mode on the right.
I just tried to lock down the big wheel whenever the agent was not connected to a gateway. I even made some extra cuts who are not needed. But I’m done with this one. Don’t feel like optimizing anymore :wink:

Replay

2 Likes

I don’t know if that’s a really legitimate way of getting the bonus achievement, but I went for the easy way by cutting a pseudo-random link at the beginning (next to a gateway) then hope for the best.

After ~5 tries, one link somewhere in the middle of a star was cut, the agent went circling there early and my program swiftly trapped it so it couldn’t escape. :slight_smile:

50+ isn’t guarantee, but with some chance you can achieve much more. (65+!)

4 Likes

la difference vien du fait que dans les tests de submit , leu noeud “0” est utilisé par l’agent
tu doit avoir une condition qui ne fait pas passer le 0

Hi,

I have completed the last test with more than 50 links remaining but still the last trophy is blocked; Is that a bug or should I have to do something else?

Thanks!

I passed all the tests but those test are not testing for an situation when endpoint-virus-enpoint, so that there are 2 endpoints available. Now you can block random until the virus is 1 point from a endpoint.

I didn’t find this to be the case in my javascript execution. I set max recursion depth to 1 (virus being 1 point away from exit), and the virus would beat my program to the nodes. I had to set max recursion to 3 (that is, the virus would have to be 3 points away from an exit) in order to “beat” it.

It took me all evening but I put together a strategy for outplaying the Agent consistently with more than 50 links remaining. Basically, in any given cycle, the program attempts the following, in order of priority:

  1. If a link would allow the Agent to reach a gateway on the next turn, remove that link.
  2. If a gateway has only one reachable link remaining, remove that link.
  3. If at least one link exists whose removal would isolate a ‘winning node’ (a node of distance 1 from a gateway) from the Agent, ignoring gateway nodes, remove the link that maximises the number of nodes isolated.
  4. Otherwise, remove the link that would increase the distance of a winning node to the maximum possible extent from the Agent, ignoring gateway nodes.
10 Likes

How did you guys manage to resolve this puzzle. I’m using Java but that’s not the issue.
System.out.println (“0 1”);
The program will only accept hard coded integers not a integer variable. This is frustrating, I wrote the logic and tried to pass two int variables and disaster. The program complains invalid input.
Please give me an answer, why is the program designed to take only hard coded numeric values and not variables in its place. Has anyone tried in Java, if so how did you overcome this hurdle?
Please respond

You can use variable with String too.

int X=0;
int Y=1;
System.out.println (X + " " + Y);

Thank you for your response, your help is much appreciated, silly me

typo in description: gatweway in a phrase:
Nodes can only be connected to up to a single gatweway.

Same here… It’s like it was only my first successful submission that is retained :frowning:

Once you submit your solution, you should check 2 things in the report page:

  • your code scores 100%
  • use the play button on the last test to see if you indeed have more than 50 links remaining

If both are done, achievement should unlock.

Well this is the problem, in the report page

  • I have 100%
  • But when I use the play button it shows me my first successful submission… But since that time, I’ve changed my code and resubmitted it but it only retains my old submission (for the replay only because my new code is well updated on the answer section on the right of the page… )

same problem in Java:(

Hi!
I run into strange problem.
When I run tests in coding part all are succesfull. When I submit the puzzle then two tests fails. Second and the last.
Any ideas?
Thanks,

Hello,
I have a strange problem when tackling this problem in Java. The following two lines of code produce different output in the 4th test:

System.err.println(SI + " " + n);
System.out.println(SI + " " + n);

n is the index of a gateway that is connected to SI.
In the first three tests this works just fine, while in the last one, the stderr prints “35 28” and the stdout “18 26”. Any ideas?

I used a similar technique - began by isolating the node with largest amount of incidences, then proceeded to hunt for a neighbor with 3 incidences (could be generalized as the node with lowest amount of incidences neighboring with the original node). Then I cut an edge that doesn’t connect to the original node (it forms the edge of the ‘loop’). I repeated the whole process two times when I had a chance and ended up getting the 'chievement.