Look for a good approach to track the Breadth-First intersection between two nodes without knowing anything about the graph. Versus Depth-First (where you can throw the path if it doesnβt fall out), you can have quite a few βopenβ options during the traversal.
The naive approach is to build a tree with the source node as the root and all its connections as its children. Depending on the amount of space that you have, you may need to eliminate cycles when you go. You can do this with a bitmap, where each bit corresponds to a separate node in the graph. When you reach the goal of the node, you can go to the parent links to the root, and that is your way. As you advance in width first, you are sure that this is the shortest path, even if you do not eliminate the loops.
. - , - , , . , . node (s), node node ( ) .
(.. ) -. , "" , . , - ( (57509), ( ) , - . , , ( ) node, . , , , .
, . (- , , .)
, .
, ( ) . node . .
.NET 3.5, Hashset, , , . - , A * search, . , , .
If you're still a fan of treeware, there are many great books on graphs and graph searches, such as Artificial Intelligence: A Modern Approach by Peter Norwig and Stuart Russell.
The links in my answer have the error that they are Hashset: http://msdn.com/en-us/library/bb359438.aspx and A * search: http://en.wikipedia.org/wiki/A* _search_algorithm
Source: https://habr.com/ru/post/1696819/More articles:Problems transferring card cards between computers - openidWhat collaboration tools are effective for working with non-technical people? - collaborationHow can I stop losing the entire position of the IDE window when I click the debug start button? - visual-studio-2008What are some errors when redirecting .net from 2.0 to 3.5? - .net.NET Date Const (with globalization) - datetimeGPS and Embedded Development - Where can I find resources? - embeddedASP.Net UpdatePanel ImageButton calls "this._postbackSettings.async is null or not an object" - asp.netSave registry values ββin WinCE using a C # application - c #Sporadically slow calls from a .NET application for SQL Server - sql-server-2005All Articles