code: function hasIncomingEdge(list, node) {
      for (var i = 0, l = list.length; i < l; ++i) {
        if (list[i].links.find(function(e,i,a){
          return node._id == e;
        })) return true;
      }
      return false;
    }
docs: Test if a node has got any incoming edges