Stack Overflow Unhandled Exception When Saving Map

How would you have suggested I use heap? Could you give me a simple example?

I solved my issue by assigning an ID number to each node based on the order of that node within a single array that all nodes have access to. Each node now creates an array of neighbour ID numbers instead of an array of pointers to neighbours. All i needed to do then was modify my GetNeighbour function to use the id to get the actual pointer from the array that contains all of the nodes. This has reduced interdependency and stopped the overflow.