Skip to content

Fix title and add test case to topological order #66

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

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ DFS is capable of categorizing edges (u,v) into four types:

If a DFS algorithm identifies a back edge, it indicates that the graph is cyclic.

#### Dijkstra's Algorithm
### Dijkstra's Algorithm

A [greedy](../greedy) algorithm that uses BFS-like ideas and a minimum [heap](../heap) to solve single-source shortest path problems in edge weighted directed graphs like (D) in _Figure 1_.

Expand Down
2 changes: 2 additions & 0 deletions graph/topological_sort_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ func TestTopologicalSort(t *testing.T) {
{[][]int{{}, {}, {4}, {}}, []int{1, 2, 3, 4}, nil},
{[][]int{{}, {1}, {}, {3}}, []int{2, 4, 1, 3}, nil},
{[][]int{{}, {1}, {}, {3}}, []int{2, 4, 1, 3}, nil},
{[][]int{{2, 5}, {3, 4}, {}, {5}, {}}, []int{1, 2, 3, 4, 5}, nil},
{[][]int{{2}, {3}, {1}}, nil, ErrNotADAG},
{readmeGraphs["Figure_1_A"], []int{1, 2, 4, 3, 5}, nil},
{readmeGraphs["Figure_1_B"], nil, ErrNotADAG},
{readmeGraphs["Figure_1_C"], []int{1, 3, 2, 4, 5}, nil},
Expand Down