throws Exception {
vertex.setVertexID(MaxFlowVertex.floatToText(key));
Writable[] values = value.get();
FloatWritable v2 = (FloatWritable) values[0];
FloatWritable capacity = (FloatWritable) values[1];
FloatArrayWritable cost = new FloatArrayWritable();
FloatWritable[] costArray = new FloatWritable[3];
costArray[0] = new FloatWritable(0.0f); // store flow
costArray[1] = capacity; // store capacity
if (capacity.get() < 0) {
costArray[2] = new FloatWritable(-4f);
} else {
costArray[2] = new FloatWritable(-5f);
}
cost.set(costArray);
Edge<Text, FloatArrayWritable> e = new Edge<Text, FloatArrayWritable>(
MaxFlowVertex.floatToText(v2), cost);
(vertex).addEdge(e);
return true;
}