I have a waypoint graph and the typical algorithm to find cycles in my graph which works fine.
But now i want to optimise my algorithm for when i update the graph. That being only check edges/vertices that might’ve changed from the recent update.
Here is an example:
So i have a graph and it has found 4 cycles, now i am about to add the red edge, which will create two new nodes by spltting the two edges it connects to.
Currently to find all cycles from this i just go through the whole graph again, but i would like to streamline it by only checking what i need to check.
So is it enough to only find cycles starting from the two new vertices i add to my graph or would i have to do the whole graph to find the cycles?