Skip to content

Instantly share code, notes, and snippets.

View megagreg72's full-sized avatar

Brian Gauch megagreg72

View GitHub Profile
@megagreg72
megagreg72 / johnson.cpp
Last active June 29, 2017 20:19 — forked from ashleyholman/johnson.cpp
Johnson's algorithm for all-pairs shortest paths with non-integer (double) weights allowed.
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <climits>
#include <float.h>
#include <exception>
#include <set>
// This implementation of "Johnson's algorithm"