Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Circular Node Connections #297

Open
6 tasks
shige opened this issue Jan 7, 2025 · 0 comments
Open
6 tasks

Prevent Circular Node Connections #297

shige opened this issue Jan 7, 2025 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@shige
Copy link
Member

shige commented Jan 7, 2025

Task description

Implement a mechanism to prevent circular dependencies when connecting nodes. This includes preventing a node from connecting to itself and avoiding the creation of connection loops within the node network.

image

Background

Allowing circular connections between nodes can lead to various problems, such as infinite loops, application freezes, and unpredictable behavior. Specifically, a node should not be able to establish a connection with itself, and the system must not allow connections to create a closed loop (e.g., Node A -> Node B -> Node C -> Node A). This task is essential for maintaining a stable and reliable node-based system.

TODO (Optional)

  • Implement a check to prevent a node from connecting to itself.
  • Implement a cycle detection algorithm to prevent the creation of circular connection paths.
  • Provide user feedback (error message) when a circular connection is attempted.
  • Ensure that existing connections are not affected by the change unless they are circular.
  • Add test cases to verify the implemented prevention mechanisms.
  • Update the user documentation to explain this new constraint on node connections.

Additional notes (Optional)

The cycle detection algorithm should be efficient to avoid performance bottlenecks, particularly when dealing with larger node graphs. Consider using Depth-First Search (DFS) or another efficient graph traversal algorithm for this task. It should be implemented in the part of the code that handles creating/modifying node connections.

@shige shige added the help wanted Extra attention is needed label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant