18 lines
368 B
Python
18 lines
368 B
Python
|
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)
|