public void createWeightedEdgesConnecting(UniqueVertexGraph gGraph,String sStartNode,List lOtherNodes,double dStartWeight,double dNewWeight,double dDataImportance){
  if (lOtherNodes != null)   if (lOtherNodes.size() == 0) {
    VertexImpl v=new VertexImpl();
    v.setLabel(sStartNode);
    try {
      gGraph.add(v);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  Vertex vA=gGraph.locateVertex(sStartNode);
  if (vA == null) {
    vA=new VertexImpl();
    vA.setLabel(sStartNode);
    try {
      gGraph.add(vA);
    }
 catch (    Exception e) {
    }
  }
  EdgeCachedLocator ecl;
  if (eclLocator == null)   ecl=new EdgeCachedLocator(100);
 else   ecl=eclLocator;
  java.util.Iterator iIter=lOtherNodes.iterator();
  while (iIter.hasNext()) {
    VertexImpl vB=new VertexImpl();
    vB.setLabel(new String((String)iIter.next()));
    double dOldWeight=0;
    double dFinalWeight=0;
    WeightedEdge weCorrectEdge=null;
    WeightedEdge weEdge=null;
    boolean bFound=(weEdge=(WeightedEdge)ecl.locateDirectedEdgeInGraph(gGraph,vA,vB)) != null;
    if (bFound) {
      dOldWeight=weEdge.getWeight();
      weCorrectEdge=weEdge;
      dFinalWeight=dOldWeight + (dNewWeight - dOldWeight) * dDataImportance;
      weCorrectEdge.setWeight(dFinalWeight);
    }
 else {
      dFinalWeight=dStartWeight;
      try {
        gGraph.addEdge(vA,vB,dFinalWeight);
        ecl.resetCache();
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}

public void createWeightedEdgesConnecting ( UniqueVertexGraph gGraph , String sStartNode , List lOtherNodes , double dStartWeight , double dNewWeight , double dDataImportance ) { if ( lOtherNodes != null ) if ( lOtherNodes . size ( ) == 0 ) { VertexImpl v = new VertexImpl ( ) ; v . setLabel ( sStartNode ) ; try { gGraph . add ( v ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } Vertex vA = gGraph . locateVertex ( sStartNode ) ; if ( vA == null ) { vA = new VertexImpl ( ) ; vA . setLabel ( sStartNode ) ; try { gGraph . add ( vA ) ; } catch ( Exception e ) { } } EdgeCachedLocator ecl ; if ( eclLocator == null ) ecl = new EdgeCachedLocator ( 100 ) ; else ecl = eclLocator ; java . util . Iterator iIter = lOtherNodes . iterator ( ) ; while ( iIter . hasNext ( ) ) { VertexImpl vB = new VertexImpl ( ) ; vB . setLabel ( new String ( ( String ) iIter . next ( ) ) ) ; double dOldWeight = 0 ; double dFinalWeight = 0 ; WeightedEdge weCorrectEdge = null ; WeightedEdge weEdge = null ; boolean bFound = ( weEdge = ( WeightedEdge ) ecl . locateDirectedEdgeInGraph ( gGraph , vA , vB ) ) != null ; if ( bFound ) { dOldWeight = weEdge . getWeight ( ) ; weCorrectEdge = weEdge ; dFinalWeight = dOldWeight + ( dNewWeight - dOldWeight ) * dDataImportance ; weCorrectEdge . setWeight ( dFinalWeight ) ; } else { dFinalWeight = dStartWeight ; try { gGraph . addEdge ( vA , vB , dFinalWeight ) ; ecl . resetCache ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } }
creates an edge in [ ggraph ] connecting [ sbasenode ] to each node in the [ lothernodes ] list of nodes . if an edge exists , its weight is increased by [ iincreaseweight ] , else its weight is set to [ istartweight ]
