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

Improved Graph Implementations #8730

Merged
merged 12 commits into from
May 31, 2023
Prev Previous commit
Fixed error messages
  • Loading branch information
nith2001 committed May 31, 2023
commit f1426c8bdf764d7f3f4404a60b6343705f8c4849
4 changes: 2 additions & 2 deletions graphs/graph_adjacency_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def add_edge(self, source_vertex: T, destination_vertex: T) -> None:
if self.contains_edge(source_vertex, destination_vertex):
msg = (
"Incorrect input: The edge already exists between "
f"{source_vertex} or {destination_vertex}"
f"{source_vertex} and {destination_vertex}"
)
raise ValueError(msg)

Expand Down Expand Up @@ -134,7 +134,7 @@ def remove_edge(self, source_vertex: T, destination_vertex: T) -> None:
if not self.contains_edge(source_vertex, destination_vertex):
msg = (
"Incorrect input: The edge does NOT exist between "
f"{source_vertex} or {destination_vertex}"
f"{source_vertex} and {destination_vertex}"
)
raise ValueError(msg)

Expand Down
4 changes: 2 additions & 2 deletions graphs/graph_adjacency_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def add_edge(self, source_vertex: T, destination_vertex: T) -> None:
if self.contains_edge(source_vertex, destination_vertex):
msg = (
"Incorrect input: The edge already exists between "
f"{source_vertex} or {destination_vertex}"
f"{source_vertex} and {destination_vertex}"
)
raise ValueError(msg)

Expand Down Expand Up @@ -101,7 +101,7 @@ def remove_edge(self, source_vertex: T, destination_vertex: T) -> None:
if not self.contains_edge(source_vertex, destination_vertex):
msg = (
"Incorrect input: The edge does NOT exist between "
f"{source_vertex} or {destination_vertex}"
f"{source_vertex} and {destination_vertex}"
)
raise ValueError(msg)

Expand Down