Datastructure for lazy evalulation

I’m working on some visualization things and i think i need a datastructure to capture relations between ‘objects’ or ‘data’ so that i can track down the minimum set of updates.

So like A depends on B and C and if C or B gets invalidated i can get the information an update on A is needed (and btw: i have something on that, but that involves searching in lists of lists and gets unefficient with a lot of objects). Bonus question: Something that can be serialized/stored to disk would be helpful.