Skip to content

faq 28704770

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

How to get rid of "No route was found from node A to node B" error?

by Kai Nagel on 2015-05-31 12:17:01


The error looks something like

2015-05-31 15:50:33,664  WARN Dijkstra:229 No route was found from node I_22_102086 to node I_22_112380

Comments: 2


Re: How to get rid of "No route was found from node A to node B" error?

by Kai Nagel on 2015-05-31 12:22:21

The error is typically caused by a disconnected network.  This can for example happen in a situation such as this here:

Assuming that one travels on the right, then from the orange node one can go towards the east, but never come back.  (The link from the south is incoming to the node.)

The recommended solution is to run the NetworkCleaner class.  The syntax depends on your setup; from the command line it is something like

java -cp .../matsim...jar org.matsim.run.NetworkCleaner infile.xml(.gz) outfile.xml(.gz)

Calling the class without any file arguments displays a help message.


Re: How to get rid of "No route was found from node A to node B" error?

by allan on 2015-06-14 13:18:02

The steps I have followed in order to overcome this problem are the following:

1- First, I have downloaded the plugins SVN from matsim website:

http://www.matsim.org/docs/devguide/installing-subclipse

2-  Then I entered the NetworkCleaner within my code:

package adDatapackage;
 import org.matsim.api.core.v01.Scenario;
 import org.matsim.core.config.Config;
 import org.matsim.core.config.ConfigUtils;
 import org.matsim.core.controler.Controler;
 import org.matsim.core.scenario.ScenarioUtils;
 import org.matsim.core.network.algorithms.NetworkCleaner;
 public class NetworkClean {
    public static void main(String[] args) {
       Config config = ConfigUtils.loadConfig("input/config.xml");
       Scenario scenario = ScenarioUtils.loadScenario( config ) ;
       NetworkCleaner cleaner = new NetworkCleaner() ;
       cleaner.run( scenario.getNetwork() ) ;
       Controler controler = new Controler( scenario ) ;
       controler.run() ;  
    }
 }

I hope this helps anyone face similar problem

Deema

Clone this wiki locally