edge.target = _.findIndex(ctrl.nodes, function (node) {
          return node.id === edge.target;
        });