daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private int newCircuit(int startV, int currentV, Walk circuit) {
  2.         int lastVertex;
  3.  
  4.         if (circuit.isCircuit()) { //need trivial? --- I'm sure circuits can connet to themself right?
  5.             return circuit.getTotalV()-1;
  6.         }
  7.         if (circuit.isEmpty()) {
  8.             circuit.addVertex(startV); //No changes I think since no edges removed?
  9.         }
  10.         //Pretty sure even if last iteration of startV and currentV, it's all the same
  11.         else { //At least already one vertex in circuit, circuit.getTotalV() >= 1
  12.             circuit.addVertex(currentV);
  13.             lastVertex = circuit.getVertex((circuit.getTotalV()-1)-1); // Have to know the second last connection
  14.             this.unvistedE[lastVertex][currentV]--; // Subtracts unvisited edge in adjacent matrix.
  15.             this.unvistedE[currentV][lastVertex]--;
  16.             this.unvistedDegreeV[currentV]--; // Current degree now goes down.
  17.             // ??? How to find next vertex to go to? Possible for dead end? I don't think so.
  18.             // It has to be a circuit, so no matter which connecting vertex we choose we can still go to it
  19.             return newCircuit(startV,this.findConnectingVertex(currentV),circuit);
  20.         }
  21.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top