private int visitNodesRec(Node v,EdgeMap<Integer> edgeWeights){
  int maxValue=0;
  for (Edge e=v.getFirstOutEdge(); e != null; e=v.getNextOutEdge(e)) {
    if (edgeWeights.get(e) == null) {
      edgeWeights.set(e,visitNodesRec(e.getTarget(),edgeWeights) + (Integer)e.getInfo());
    }
    maxValue=Math.max(maxValue,edgeWeights.get(e));
  }
  return maxValue;
}

private int visitNodesRec ( Node v , EdgeMap < Integer > edgeWeights ) { int maxValue = 0 ; for ( Edge e = v . getFirstOutEdge ( ) ; e != null ; e = v . getNextOutEdge ( e ) ) { if ( edgeWeights . get ( e ) == null ) { edgeWeights . set ( e , visitNodesRec ( e . getTarget ( ) , edgeWeights ) + ( Integer ) e . getInfo ( ) ) ; } maxValue = Math . max ( maxValue , edgeWeights . get ( e ) ) ; } return maxValue ; }
recursively visit all nodes and set edge weights the weight of an edge e is the maximum sum of overlaps on any outgoing path from e
