Multi Thread Closest Facility Solver on .Net C#

2225
5
08-07-2012 12:33 AM
Highlighted
New Contributor
Hello,

I???m working on a ClosestFacilitySolver (Network Analyst) project on .Net SDK of ArcGIS Version 10.0. I have 1500 facilities and 40 million incidents. It did not work to solve closest facilities for all incidents.

Then I have grouped incidents by zones. First I worked on a single thread and it was solved for one zone (56.000 Incidents). But single thread solution did not solve my problem perfectly. Because I have 40 million incidents and I have to solve problem in a realistic time. So I need to work on multi zones at the same time. Then I tried multi thread solution but it did not work.

I need some advice for this problem solution and I need any sample or information about multi threading.

Thank you.
Tags (2)
Reply
0 Kudos
5 Replies
Highlighted
Esri Regular Contributor
Since you are working with a very large number of "incidents", perhaps there is some other way to solve the problem.
Can you elaborate what you want the overall solution to do?

For example, do you route geometries/directions of the closest facilities?
If not then you could be using the OD solver.

Do the facilities need to be within a certain distance, say 20 miles? That is, can you put a cutoff?
If indeed you can put a small cutoff, then you should turn off hierarchy if that is ON.

And perhaps you have already run Calculate Locations on your 40 million points so that they can load quickly the next time around.

Can you also say why the single thread with one zone did not work perfectly for you?

Jay Sandhu
Reply
0 Kudos
Highlighted
New Contributor
I want to find closest facility to an incident and get measure between these two points. I don't know anything about OD Solver. Can you give some informations about it?

I put cutoff 30 miles and I run calculations for a sample zone which contains 56.000 incidents. It works but I think it can calculate faster.

�?zgür.
Reply
0 Kudos
Highlighted
New Contributor
In addition, I want to run calculations on multithreads/multizones and in parallel.

How can I do it? Do you have any idea?

Thanks.

-�?zgür
Reply
0 Kudos
Highlighted
Esri Regular Contributor
If you only need the "measure" and not the actual geometry of the route then use OD. It is very simillar to Closest Facility with the main difference being the route geometry. It computes network distances between a set of Origins and a set of Destinations. The Facilities in Closest Facility become destinations and the Incidents beceom Origins. Since you have a 30 minute cutoff and only want ONE closest, make sure the hierarchy is off and it will run very fast. I would suggest that you try your 56,000 sample with OD. More help here:
http://resources.arcgis.com/en/help/main/10.1/#/OD_cost_matrix_analysis/00470000004r000000/


The only way to multi-thread is to write an executable (VB.Net or C#) that solves an OD and run it many times (at the same time) with different inputs (e.g., in different command windows). Or have an ArcGIS server where you can publish a service and send multiple requests.

Another thing you can do is create a model from the OD and load it with the 1500 destinations, then call it with a different set of origins (maybe select 200,000 at a time and iterate over the 40 million) writing out the results to a file.

Jay Sandhu
Reply
0 Kudos
Highlighted
New Contributor
I will try OD with my 56.000 points. I need network and direct distance and I think OD can calculate direct distance also.
Can you send me any sample about OD?

If OD solves my problem than I can write scheduled job which calls OD Solver executable many times with different inputs.

Thanks a lot for information.
Reply
0 Kudos