Skip to content

Latest commit

 

History

History

skynet-revolution2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Skynet Revolution - Episode 2

Puzzle Summary

In this puzzle, you need to stop a Bobnet agent from reaching exit gateways in a network by severing links. The network is represented by nodes and links, and the agent moves from node to node. Your goal is to disconnect the agent from the exit gateways without letting it reach a gateway.

Hints

  1. Understand the Problem:

    • Before you start, make sure you understand the problem statement, the input, and the goal.
  2. Input Parsing:

    • Parse the initialization input to obtain the network structure, including nodes, links, and exit gateways.
  3. Graph Representation:

    • Create a graph representation of the network. You can use an adjacency list or matrix to store the connections between nodes.
  4. Graph Traversal:

    • Implement a graph traversal algorithm to find paths from the Bobnet agent's current position to exit gateways. You can use depth-first search (DFS) or breadth-first search (BFS) for this purpose.
  5. Sever Links Strategically:

    • Observe the paths that the agent can take to reach the exit gateways.
    • Identify links in these paths and sever them to block the agent's progress.
    • Be careful not to sever links that lead to gateways, as this will result in immediate failure.
  6. Loop and Iterate:

    • After each link severance, reevaluate the situation using your graph traversal algorithm to see if the agent can still reach a gateway.
    • Continue to sever links strategically until the agent is cut off from all exit gateways.
  7. Output Format:

    • The output for one game turn should be in the format "C1 C2," where C1 and C2 are the indices of the nodes you wish to sever the link between.
  8. Optimization:

    • Optimize your algorithm for efficiency, as you have a time constraint for each turn. Consider using data structures like sets or lists to keep track of severed links efficiently.
  9. Infinite Loop:

    • Your program should run within an infinite loop, reading the current state of the Bobnet agent and providing the next instruction in response.
  10. Test and Debug:

  • Test your code with the provided test cases, and if it's not working correctly, debug and refine your approach.
  1. Handle Edge Cases:
  • Make sure your code handles all possible edge cases and constraints specified in the problem statement.
  1. Think Strategically:
  • Think strategically about which links to sever to cut off the agent while minimizing the number of actions you need to take.

Remember that the optimal solution may involve dynamic decision-making based on the current state of the network, so adapt your approach accordingly.