Something like: https://github.com/mikolalysenko/bipartite-vertex-cover/blob/master/vcover.js I can make a pull request when I'm done.