int srcValue = (int) costFunction.getCost(new mxCellState(view, aGraph.getTerminal(edge, true), null));
int destValue = (int) costFunction.getCost(new mxCellState(view, aGraph.getTerminal(edge, false), null));
if (aGraph.getTerminal(edge, false) != null || aGraph.getTerminal(edge, true) != null)
{
Object[] cells = model.cloneCells(aGraph.getChildCells(graph.getDefaultParent(), true, true), true);
mxGraphModel modelCopy = new mxGraphModel();
mxGraph graphCopy = new mxGraph(modelCopy);
graphCopy.addCells(cells);
mxAnalysisGraph aGraphCopy = new mxAnalysisGraph();
aGraphCopy.setGraph(graphCopy);