protected List<MapNode[]> subdivideProblem(List<MapNode> markers,OsmMap map,MapWayFilter wayFilter){
  List<MapNode[]> result=new ArrayList<MapNode[]>();
  MapNode fromNode=map.getNearestWayNode(new Position(markers.get(0)),wayFilter);
  for (int i=1; i < markers.size(); i++) {
    MapNode toNode=map.getNearestWayNode(new Position(markers.get(i)),wayFilter);
    result.add(new MapNode[]{fromNode,toNode});
    fromNode=toNode;
  }
  return result;
}

protected List < MapNode [ ] > subdivideProblem ( List < MapNode > markers , OsmMap map , MapWayFilter wayFilter ) { List < MapNode [ ] > result = new ArrayList < MapNode [ ] > ( ) ; MapNode fromNode = map . getNearestWayNode ( new Position ( markers . get ( 0 ) ) , wayFilter ) ; for ( int i = 1 ; i < markers . size ( ) ; i ++ ) { MapNode toNode = map . getNearestWayNode ( new Position ( markers . get ( i ) ) , wayFilter ) ; result . add ( new MapNode [ ] { fromNode , toNode } ) ; fromNode = toNode ; } return result ; }
factory method , responsible for subdividing the overall problem which is specified by a list of marker nodes . it returns arrays of way nodes . the arrays will be used to define problems to be solved one after another . this implementation returns pairs of from and to way nodes .
