Skip to content

Instantly share code, notes, and snippets.

View myjr52's full-sized avatar

Jongrae.K myjr52

View GitHub Profile
@avrilcoghlan
avrilcoghlan / dijkstra_example.py
Last active October 8, 2018 18:53
Python script to implement Dijkstra's algorithm for an undirected graph
# define function 'xrange'
def xrange(x):
return iter(range(x))
genes = ['g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7']
Matrix = [[0 for x in xrange(7)] for x in xrange(7)]
Matrix[1-1][4-1] = 12
Matrix[4-1][1-1] = 12