public void removeEdge(int from, int to) {
// if the size is one, then it is a new leaf
final TIntArrayList fromOutList = this.outAdjLists.get(from);
if (fromOutList.size() == 1) {
this.numOfLeaves++;
fromOutList.resetQuick();
} else {
int index = this.getNeighborIx(from, to);
// switch the out edge in the list
fromOutList.set(index, fromOutList.get(fromOutList.size() - 1));
fromOutList.removeAt(index);