Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Search algorithms for graphs #30

Open
Assignees
rabestro
Labels
enhancementNew feature or request
@rabestro

Description

@rabestro

Story

As a user, I would like to find theshortest and thefastest routes in the graph. For the shortest path, theBread First Search algorithm should be used. For the fastest path, we should useDijkstra's algorithm.

Example

Given

a complex graph with eight nodes

Graph Schema

VertexEdges
A[B:5, H:2]
B[A:5, C:7]
C[B:7, D:3, G:4]
D[C: 20, E: 4]
E[F: 5]
F[G: 6]
G[C: 4]
H[G: 3]

When

we use the Breadth-First Search algorithm for the first route.
and
we use Dijkstra's algorithm for the second route.

Then

the first route is the shortest
and
the second route is the fastest

Where

The results for this graph are presented in the table

sourcetargettimeshortesttimefastest
AA0[A]0[A]
BB0[B]0[B]
AB5[A, B]5[A, B]
BA5[B, A]5[B, A]
AC12[A, B, C]9[A, H, G, C]
CA12[C, B, A]12[C, B, A]
AG5[A, H, G]5[A, H, G]
CD3[C, D]3[C, D]
DC20[D, C]19[D, E, F, G, C]
BD10[B, C, D]10[B, C, D]
DB27[D, C, B]26[D, E, F, G, C, B]
DH34[D, C, B, A, H]33[D, E, F, G, C, B, A, H]

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp