// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/VertexProgram.java
// public interface VertexProgram extends Serializable {
// 
//     public enum KeyType {
//         VARIABLE,
//         CONSTANT
//     }
// 
//     /**
//      * The method is called at the beginning of the computation.
//      * The method is global to the GraphComputer and as such, is not called for each vertex.
//      *
//      * @param graphMemory The global GraphMemory of the GraphComputer
//      */
//     public void setup(GraphMemory graphMemory);
// 
//     /**
//      * This method denotes the main body of computation.
//      *
//      * @param vertex      the vertex to execute the VertexProgram on
//      * @param graphMemory the shared state between all vertices in the computation
//      */
//     public void execute(Vertex vertex, GraphMemory graphMemory);
// 
//     /**
//      * The method is called at the end of a round to determine if the computation is complete.
//      * The method is global to the GraphComputer and as such, is not called for each vertex.
//      *
//      * @param graphMemory The global GraphMemory of the GraphComputer
//      * @return whether or not to halt the computation
//      */
//     public boolean terminate(GraphMemory graphMemory);
// 
//     public Map<String, KeyType> getComputeKeys();
// 
// 
// }


import com.google.common.base.Preconditions;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.furnace.algorithms.vertexcentric.VertexProgram;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
package com.tinkerpop.furnace.algorithms.vertexcentric.computers;



/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class ParallelGraphComputer extends AbstractGraphComputer {

    int threads = Runtime.getRuntime().availableProcessors() - 1;
    int chunkSize = 1000;

// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/VertexProgram.java
// public interface VertexProgram extends Serializable {
// 
//     public enum KeyType {
//         VARIABLE,
//         CONSTANT
//     }
// 
//     /**
//      * The method is called at the beginning of the computation.
//      * The method is global to the GraphComputer and as such, is not called for each vertex.
//      *
//      * @param graphMemory The global GraphMemory of the GraphComputer
//      */
//     public void setup(GraphMemory graphMemory);
// 
//     /**
//      * This method denotes the main body of computation.
//      *
//      * @param vertex      the vertex to execute the VertexProgram on
//      * @param graphMemory the shared state between all vertices in the computation
//      */
//     public void execute(Vertex vertex, GraphMemory graphMemory);
// 
//     /**
//      * The method is called at the end of a round to determine if the computation is complete.
//      * The method is global to the GraphComputer and as such, is not called for each vertex.
//      *
//      * @param graphMemory The global GraphMemory of the GraphComputer
//      * @return whether or not to halt the computation
//      */
//     public boolean terminate(GraphMemory graphMemory);
// 
//     public Map<String, KeyType> getComputeKeys();
// 
// 
// }


// Path: src/main/java/com/tinkerpop/furnace/algorithms/vertexcentric/computers/ParallelGraphComputer.java
import com.google.common.base.Preconditions;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.furnace.algorithms.vertexcentric.VertexProgram;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

package com.tinkerpop.furnace.algorithms.vertexcentric.computers;



/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class ParallelGraphComputer extends AbstractGraphComputer {

    int threads = Runtime.getRuntime().availableProcessors() - 1;
    int chunkSize = 1000;

    public ParallelGraphComputer(final Graph graph, final VertexProgram vertexProgram, final Isolation isolation) {