Answer the question
In order to leave comments, you need to log in
How to create an adjacency matrix based on a 2D map?
Hello. The problem is the following, there is a map (as in the picture). You need to build an adjacency matrix, where 1 row is the cell where the monster is. What algorithm can do this?
Answer the question
In order to leave comments, you need to log in
Since there are no "portals", any cell can be accessed from a maximum of 4 adjacent ones.
Number the cells, go around each, count how many of the four neighbors are available - not a wall, not outside the map.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question