Skip to content

Shortest path operation #10

Description

@D4L

Path Operations

Task

Implement the ability to find the shortest path

Content
  • Finding the shortest path between two vertices
  • Checking if a path between two vertices exists
Example

Assume graph is K3 ( { v1, v2, v4 }, { edges formed with sum (e##) } ) with non-connected v3

graph.path_exist? "v1", "v2" # true
graph.path "v1", "v2"        # ["v1", "v2"] ordered array
graph.path_exist? "v1", "v3" # false
graph.delete_edge! "e3" # graph
graph.path" v1", "v2"        # ["v1", "v4", "v2"]

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions