Skip to content

Instantly share code, notes, and snippets.

View jennakwon06's full-sized avatar

Jenna Kwon jennakwon06

View GitHub Profile
@econchick
econchick / gist:4666413
Last active December 22, 2023 13:32
Python implementation of Dijkstra's Algorithm
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):
@stober
stober / rargmax.py
Created February 29, 2012 18:46
Random Argmax in Python
#!/usr/bin/env python
"""
Author: Jeremy M. Stober
Program: RARGMAX.PY
Date: Wednesday, February 29 2012
Description: Simple rargmax function.
"""
import numpy as np