Skip to content

Instantly share code, notes, and snippets.

View s311354's full-sized avatar
🍀
I may be slow to respond.

Louisliu s311354

🍀
I may be slow to respond.
View GitHub Profile
@s311354
s311354 / graph.py
Last active December 16, 2022 08:46
Basic Graph Traversal Algorithm
from typing import List, Union, Set
class Graph():
"""Docstring for Graph. """
def __init__(self) -> None:
"""TODO: to be defined. """
# Adjacency set representation.
# key: node name, value: adjacency node name set
self.edges = dict()