Skip to content

Instantly share code, notes, and snippets.

View lakshmin121's full-sized avatar

Lakshminarayanan Mohana Kumar lakshmin121

  • UNSW
  • Sydney
View GitHub Profile
@gerryjenkinslb
gerryjenkinslb / graph.py
Created May 15, 2018 19:41
Undirected Graph with edge data (python)
# Undirected Graph ADT with edge data stored as adj_vertices dict for each Vertex
# The key to each edge is a nomalized tuple of the vertex ids ordered from low to high
# edge id (eid) for v1, v2 is (v1,v2) or (v2,v1) such that the first tuple item is less than second
def edge_id(v1,v2): # normalize key v1,v2 to tuple (v_low,v_hi)
return (v1, v2) if v1 <= v2 else (v2, v1)
class Vertex(object):
@WetHat
WetHat / PY-Drawing3D.ipynb
Last active April 26, 2025 09:22
Matplotlib: 3D Arrows and 3D Annotations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.