Find a path on the graph

Simply speaking , It's division from the starting point , Mark every point you pass , Back off when you find the end , Called deep search .

Judging from V Can we get to the end

Define a function , Judge if it's the end you want , If so , It's over , No. , Just walk over and mark , For other adjacent nodes , If that's the point, it's over , If not, continue .

From here on, the content mainly comes from Guo Wei of Peking University , I study as a note
bool Dfs(V) { if( V End point ) return true; if( V Old point ) return false; take V Mark as old point ;
Right and V Every adjacent node U{ if( Dfs(U) == true) return true; } return false; } int main() {
Mark all points as new ; Starting point = 1 End = 8 cout << Dfs( Starting point ); }
If you need to record the path : Add path[depth];
Node path[MAX_LEN]; //MAX_LEN Just take the total number of nodes int depth; bool Dfs(V) { if( V End point ){ path[
depth] = V; return true; } if( V Old point ) return false; take V Mark as old point ; path[depth]=V; ++
depth; 1516 Right and V Every adjacent node U { if( Dfs(U) == true) return true; } --depth; return
false; }
Representation of Graphs

Using a two-dimensional array G Storage map ,G[i][j] Representation node i Node j of
Situation on the border ( If there is no edge , Edge direction , Weight size, etc )

Technology
©2019-2020 Toolsou All rights reserved,
java Comparing attribute values between two objects utilize Python handle Excel data ——xlrd,xlwt library Bidirectional linked list Why? Python Not a future oriented programming language ?Python【 Assignment statement 】 Special lecture , You can't just a=b ah ! Suggest mastering ! utilize Python handle Excel data ——pandas library see SQL-SERVER Data volume and occupied space of database and each table PID The algorithm finally figured out the principle , It was so simple web Two front-end practical games ( Attached source code ) Beginners learn Python Be sure to know what his basic algorithms are ? What is the function ?