Skip to content

Instantly share code, notes, and snippets.

View mHamzaArain's full-sized avatar

Hamza Arain mHamzaArain

View GitHub Profile
@mHamzaArain
mHamzaArain / MST.py
Created April 24, 2019 19:04 — forked from Peng-YM/MST.py
Prim and Kruskal algorithm written in Python
# coding: utf-8
import re
# Class WeightedGraph
class WeightedGraph:
def __init__(self, path):
# open file to initialize the graph
file = open(path, "r")
p = re.compile("\d+")