Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - depth first search in cpp
Search - depth first search in cpp - List
Implemented BFS, DFS and A* To compile this project, use the following command: g++ -o search main.cpp Then you can run it: ./search The input is loaded from a input file in.txt Here is the format of the input file: The first line of the input file shoud contain two chars indicate the source and destination city for breadth first and depth first algorithm. The second line of input file shoud be an integer m indicate the number of connections for the map. Following m lines describe the map, each line represents to one connection in this form: dist city1 city2, which means there is a connection between city1 and city2 with the distance dist. The following input are for A* The following line contains two chars indicate the source and destination city for A* algorithm. Then there is an integer h indicate the number of heuristic. The following h lines is in the form: city dist which means the straight-line distance from the city to B is dist.
Update : 2008-10-13 Size : 2.91kb Publisher : bo

深度优先搜索算法解决八码难题-depth-first search algorithm to solve eight problems yards
Update : 2025-02-19 Size : 2kb Publisher : 高兵

DL : 0
数据结构里的dfs算法,包括递归与非递归。用vc6.0编写-data structure, the dfs algorithms, including recursive and non- recursive. Prepared with vc6.0
Update : 2025-02-19 Size : 1kb Publisher : 叶芦芦

Implemented BFS, DFS and A* To compile this project, use the following command: g++ -o search main.cpp Then you can run it: ./search The input is loaded from a input file in.txt Here is the format of the input file: The first line of the input file shoud contain two chars indicate the source and destination city for breadth first and depth first algorithm. The second line of input file shoud be an integer m indicate the number of connections for the map. Following m lines describe the map, each line represents to one connection in this form: dist city1 city2, which means there is a connection between city1 and city2 with the distance dist. The following input are for A* The following line contains two chars indicate the source and destination city for A* algorithm. Then there is an integer h indicate the number of heuristic. The following h lines is in the form: city dist which means the straight-line distance from the city to B is dist. -Implemented BFS, DFS and A* To compile this project, use the following command: g++-O search main.cppThen you can run it:./SearchThe input is loaded from a input file in.txtHere is the format of the input file: The first line of the input file shoud contain two chars indicate the source and destination city for breadth first and depth first algorithm. The second line of input file shoud be an integer m indicate the number of connections for the map. Following m lines describe the map, each line represents to one connection in this form: dist city1 city2, which means there is a connection between city1 and city2 with the distance dist. The following input are for A* The following line contains two chars indicate the source and destination city for A* algorithm.Then there is an integer h indicate the number of heuristic.The following h lines is in the form: city dist which means the straight-line distance from the city to B is dist.
Update : 2025-02-19 Size : 3kb Publisher : bo

This code do depth first search algorithm. Adjacency matrix symbolize every edge in the graph, for example adj[i][j]=1 is an edge from i to j, i and j are vertices.
Update : 2025-02-19 Size : 1kb Publisher : Dennis

图的数据结构,打包cpp,1.创建图 创建图 G(任选邻接矩阵或表) 2. 显示图 3. 深度优先搜索遍历图 4. 广度优先搜索遍历图 5. 在图中插入顶点 6. 在图中插入边- Graph data structure, packaging cpp, 1. Create a map creation graph G (optional adjacency matrix or table) 2. Display Figure 3. depth-first search traversal diagram The breadth-first search traversal diagram 5. Insert vertex in the graph 6. Insert the edge in the figure
Update : 2025-02-19 Size : 3kb Publisher : guyuqian
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.