Unity Procedural Flood Fill
Seeds a 2D array at random, then uses a breadth-first-search algorithm to populate the rest of the 2D array with data.
This implementation transforms a 2D array into a hex grid, but your implementation can be any kind of Node structure as long as it supports a function to get adjacent nodes (GetAdj()). This implementation relies upon the properties of the 2D array to detect node adjacencies. If nodes have their adjacencies specified beforehand, no backing 2D array is needed.
Nodes which have their property “value” populated will propagate their values to adjacent nodes. A breadth-first pass through the graph is used to give all nodes a non-zero value.
How to use
Create a gameObject and attach ScriptFillerNode to it. Create a gameObject prefab which has a ScriptNode attached to it or in some way supports a GetAdj() call. The ScriptFillerNode will instantiate all nodes, will set a few seed node values, and will then propagate those values through the grid of nodes.