@Override
    public void delete(Node s) throws NodeException {
        if(s == null) {
            throw new NodeException("cannot delete null node");
        }
        int numNode = s.getNodeNum();
        for( int i=0;i<node.size();++i)
        {
            if(i == numNode) {
                continue;
            }
            List<Edge> edge = node.get(i).getEdge();
            for(int j = 0;j<edge.size();j++)
            {
                Edge cE = edge.get(j);
                if(cE.getNodeA() == numNode ||cE.getNodeB() == numNode)
                {
                    edge.remove(j);
                }
            }
        }
        boolean remove = node.remove(s);
        if(!remove) {
            throw new NodeException("remove node error");
        }
        if(numNextNode >numNode)
        {
            numNextNode = numNode;
        }
        nbNode--;
    }