C
C#16mo ago
Theos

Convert 2D grid into graph

Hey, as in the title, I have a simple Vector2Int[,] grid that I want to convert into a graph. How can I do this?
6 Replies
Theos
Theos16mo ago
starting from grid[0][0]
Sal
Sal16mo ago
System.Windows.Shapes Namespace
Provides access to a library of shapes that can be used in Extensible Application Markup Language (XAML) or code.
cap5lut
cap5lut16mo ago
can u give more information about what kind of data that grid contains? i mean, sure its a 2d vector, but what does that represent? what should the resulting graph represent?
Omnissiah
Omnissiah16mo ago
oh man i thought graph as in mathematical structure graph, i was like oh no anyway tbh you could also think of drawing said graph depends what representation you need
Theos
Theos16mo ago
basically its just a map for the game. Each cell in this grid is a Cell class with int x,y positions and Item item in it. I need a graph that will connect all the neighbours want to use it for the Breadth First Search algorithm
Omnissiah
Omnissiah16mo ago
so i was right then data structure would be sort of tied to the algorithm you want to use it could be something using a quadtree or a linked list you could even just use your matrix it depends on the implementation
Want results from more Discord servers?
Add your server