GTF Example for node Graphs with ImGui. When you change a connection, it just marks the input in connected nodes as dirty, then all nodes are updated every frame, so, when they have some input invalid, compute it's value again and mark it's output as dirty if needed.
Source code can be downloaded from: https://github.com/Galloscript