Initialized graph classes

This commit is contained in:
Marcin Kostrzewski 2022-06-16 18:39:16 +02:00
parent 378e2eba97
commit 03d02a7c3f

View File

@ -0,0 +1,18 @@
class Node:
def __init__(self):
self.is_infected = False
class Edge:
def __init__(self, node_a: Node, node_b: Node, weight: float):
self.node_a = node_a
self.node_b = node_b
self.weight = weight
class Graph:
def __init__(self):
self.edges = []
def add_edge(self, edge: Edge):
self.edges.append(edge)