Skip to content

Commit

Permalink
use weighted func
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Singer committed Oct 9, 2023
1 parent 7d16954 commit 7813268
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions paths_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,9 @@ func TestUndirectedShortestPath(t *testing.T) {
for name, test := range tests {
var graph Graph[string, string]
if test.isDirected {
graph = New(StringHash, Directed())
graph.(*directed[string, string]).traits.IsWeighted = test.isWeighted
graph = New(StringHash, Directed(), Weighted())
} else {
graph = New(StringHash)
graph.(*undirected[string, string]).traits.IsWeighted = test.isWeighted
graph = New(StringHash, Weighted())
}

for _, vertex := range test.vertices {
Expand Down Expand Up @@ -574,8 +572,7 @@ func Test_BellmanFord(t *testing.T) {
},
}
for name, test := range tests {
graph := New(StringHash, Directed())
graph.(*directed[string, string]).traits.IsWeighted = test.isWeighted
graph := New(StringHash, Directed(), Weighted())

for _, vertex := range test.vertices {
_ = graph.AddVertex(vertex)
Expand Down

0 comments on commit 7813268

Please sign in to comment.