Using graph search to solve real-world problems in C#

Most day-to-day C# work involves flat collections: filter a list, sort a table, look something up by key. Those shapes are well served by LINQ and a dictionary. But some problems are about relationships rather than records, and flat collections handle them badly.

A few examples that show up in real systems:

Which permissions does a user inherit through nested role groups?

Which build targets need to rebuild when this one file changes?