jacomyal/sigma.js — pull request #57 by tjdett (2012-11-06 06:35:05+00:00)
Title: Faster implementation for dropping nodes in big graphs

The previous drop implementation was inefficient for the removal of significant numbers of nodes from large graphs.

It had an `O(m*n)` worst case performance (where `m` is the number of nodes to remove, and `n` is the total number of nodes).

This implementation takes advantage of a [hashset being more efficient than an array for searching](http://jsperf.com/array-search-in-vs-loop) to reduce that to `O(m+n)`. Edge removal should also be substantially quicker.

The best-case performance for removing small numbers of nodes should be marginally worse.