Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - DFS.cpp
Search - DFS.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-17 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-17 Size : 1kb Publisher : 叶芦芦

BFS、DFS、有向图、无向图中的各种算法的实现,可以自动生成图形。-BFS, DFS, to the map, no map to the realization of the algorithm can be automatically generated graphics.
Update : 2025-02-17 Size : 117kb 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-17 Size : 3kb Publisher : bo

图可以采用邻接矩阵、邻接表等多种方式来存储,本程序实现图的邻接矩阵存储-Chart can be used adjacency matrix, adjacency lists to store a variety of ways, this program graph adjacency matrix storage
Update : 2025-02-17 Size : 1kb Publisher : youjing

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-17 Size : 1kb Publisher : Dennis

This code do Depth First Search and marks every edge as Back Edge, Forward Edge, Tree edge and Cross edge.
Update : 2025-02-17 Size : 1kb Publisher : Dennis

这份代码是一个深度搜索图的实例代码,但是效率不是很高,只能实现深度优先的遍历-The code is written for DFS to search for the answers! enjoy it please everybody.I use this stage at the first time.
Update : 2025-02-17 Size : 1kb Publisher : ARTHUR FU

DFS algorithm on graphs.
Update : 2025-02-17 Size : 1kb Publisher : forall360

Depth first search algorithm on graphs.
Update : 2025-02-17 Size : 1kb Publisher : forall360

自己实现的重要的数据结构以及算法(包括dfs,bfs,huffman code,kmp,dij等)。每一个.cpp或.c文件都是一个可直接运行的程序。-Important data structures and algorithms to achieve their own (including dfs, bfs, huffman code, kmp, dij, etc.). Every one. Cpp or. C file is a program can be run directly.
Update : 2025-02-17 Size : 45kb Publisher : 欧龙崎
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.