Current behavior
No edge contraction implementation.
This is a limiting factor for implementing any algorithms with edge contractions.
Desired behavior
The app should include edge contraction logic.
This is both for the UI side: animations and so on
And the logic side: Changing a graph according to the contraction.
Approach
Implementing the logic side should be pretty simple.
Given two connected vertices, create a new vertex, connect all relevant edges to it, delete the previous two vertices, and make sure no double edges exist.
The animation side is more complex. I was thinking of getting the two vertices to just pull towards each other, after which the new joined vertex will appear instead of them, and double edges will just disappear. A reverse animation needs to be implemented as well!
Important : This implementation needs to include functions that allow to log the contraction in a timeline, similarly to how we change colors and so on. When edge contracting algorithms are implemented, they will log these contractions, for which we will need to have an undo action as well!
Current behavior
No edge contraction implementation.
This is a limiting factor for implementing any algorithms with edge contractions.
Desired behavior
The app should include edge contraction logic.
This is both for the UI side: animations and so on
And the logic side: Changing a graph according to the contraction.
Approach
Implementing the logic side should be pretty simple.
Given two connected vertices, create a new vertex, connect all relevant edges to it, delete the previous two vertices, and make sure no double edges exist.
The animation side is more complex. I was thinking of getting the two vertices to just pull towards each other, after which the new joined vertex will appear instead of them, and double edges will just disappear. A reverse animation needs to be implemented as well!
Important : This implementation needs to include functions that allow to log the contraction in a timeline, similarly to how we change colors and so on. When edge contracting algorithms are implemented, they will log these contractions, for which we will need to have an undo action as well!