Line maze solver

At its simplist all you need is tree data structure where you have a node for each intersection. Each node will have 3 pointer to the node for the next intersection

any sample of source code that can use in a arduino? :-?
thanks in advance