Skip to content

Implement edge contraction #90

Description

@YotamAshman

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Algorithm PlayerThe core logic of algorithm playingUIThings connected to the visual part of the projectenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions