Develop your own heuristic algorithm. Identify simple criteria and strategies to find short paths. This algorithm should be taken as a baseline.

There are two game modes:

  • The time spent on a cell is the number on this cell
  • The time spent on a cell is the absolute of the difference between the previous cell the agent was on and the current cell it is on

–  Implementation of the game. Implement the game in a structured and flexible way to allow the selection of game modes and parameters. Build a method to build and visualize the grid filled with random numbers. Build a method to visualise a path. (30%)

–  Develop your own heuristic algorithm. Identify simple criteria and strategies to find short paths. This algorithm should be taken as a baseline. (10%)

Write your own code as much as possible and provide detailed comments of each step. Relying on more sophisticated implementations available online is not the objective of the task, but to be able to write your own code. (30%)

–  Plan and implement a statistical analysis to characterize the length of the shortest path in dependence of several parameters of the grid and comparing the two game modes. Relevant parameters are size of the grid, distribution from which cell numbers are generated, etc. (30%)

An agent can move from cell to cell (U, D, L, R).

Each time it enters a cell, it spends some time in this cell.

2 game modes:

–        the number on the cell indicates time spent on the cell

–        the absolute difference between origin cell and destination cell indicates the time spent on the cell.

The goal is to move from top-left to bottom-right position as fast as possible.

Game: creating the environment:

Implementation of the game (30%)

  • Think which is the optimal architecture for your code:
  • Subclasses for the 2 modes of the game?
  • If so, which methods are subclass specific, or not? Explain and justify your selection.
  • Create attributes and methods to:
  • Generate any rectangular size of the grid
  • Populate the cells with random numbers
  • Select specific distributions of the random numbers
  • Visualize the game
  • Compute and visualize the cost of specific paths

Game: finding the shortest path:

  • Propose a naïve approach (not too naïve) (10%):
  • Look for neighbours
  • Build a tree
  • Explain your heuristics. Please, think these simple criteria and strategies before learning the Dijkstra algorithm
  • Implement Dijkstra’s algorithm to find the shortest path between 2 points (30%)
  • How the algorithm maps to the game setting? How it varies for the two game modes?
  • Do not copy/paste an implementation from online code. Comment the code so that it is clear that you understand what does what.
  • Use a version of the algorithm close to the original one

Game: analyze factors affecting the shortest path:

Design and implement an analysis of factors that affect the length of the shortest path (30%)