Fix the generics on graphs and algorithms.