HeYStRanGeR
article thumbnail
[python] DFS, BFS 구현
Computer Science/algorithms 2023. 3. 16. 23:47

(23.03.16) (최종 업데이트: 23.05.14) https://github.com/gompaang/algorithm_python GitHub - gompaang/algorithm_python Contribute to gompaang/algorithm_python development by creating an account on GitHub. github.com DFS, BFS는 탐색 알고리즘의 대표적인 2가지 알고리즘이다. DFS,BFS 구현시 알아두어야하는 자료구조 #reference: https://data-marketing-bk.tistory.com/44 #depth-first search #1. dfs by python list (stack) def dfs_list(graph, start..

article thumbnail
[algorithms] ch4. Paths in graphs (Breadth-first search)
Computer Science/algorithms 2023. 3. 16. 20:40

(23.03.16) algorithms S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani (2008) 책 읽고 정리하기 http://algorithmics.lsi.upc.edu/docs/Dasgupta-Papadimitriou-Vazirani.pdf 정리한 내용 4.1 Distances 4.2 Breadth-first search 4.3 lenghts on edges BFS 예제 수업 들으면서 정리해두었던, DFS, BFS 개념과 예제 https://hey-stranger.tistory.com/153 [알고리즘] Network flow : BFS & DFS (2021.11.12) 알고리즘 수업들으면서 정리하기 19탄 w10-3 녹화강의, w11-1 실강 BFS..

article thumbnail
[algorithms] ch3. Decompositions of graphs (DFS: 깊이 우선 탐색)
Computer Science/algorithms 2023. 3. 14. 01:07

(23.03.13) algorithms S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani (2008) 책 읽고 정리하기 http://algorithmics.lsi.upc.edu/docs/Dasgupta-Papadimitriou-Vazirani.pdf 정리한 내용 3.1 why graphs? 3.2 Depth-fist search in undirected graphs 3.3 Depth-first search in directed graphs Depth-first search in undirected graphs예시 풀이 과정 Depth-first search in directed graphs 예시 풀이 과정

article thumbnail
[알고리즘] Network flow : BFS & DFS
Computer Science/algorithms 2021. 11. 12. 16:57

(2021.11.12) 알고리즘 수업들으면서 정리하기 19탄 w10-3 녹화강의, w11-1 실강 BFS,DFS 내용이다. Network flow graph 알고리즘 - Breadth-first search - Depth-first search - Minimum spanning tree (Prim's algorithms) - Maximum flow (The Ford-Fulkerson method) graph G=(V,E) 로 표현한다. - V는 vertices 의 집합 (G.V) - E는 edges 의 집합 (G.E) G는 방향성일 수도 있고, 무방향성일 수도 있다. (directed, undirected) 보통 graph는 인접리스트나 인접행렬로 표현한다. BFS(Breadth-first search)..

article thumbnail
[자료구조] DFS 깊이 우선 탐색
Computer Science/자료구조 2021. 7. 19. 18:20

(2021.07.19) 자구 7주차 과제랑 연결 깊이 우선 탐색 (Depth First Search) 깊이 우선탐색 (DFS) 은 시작 정점의 한 방향으로 갈 수 있는 경로가 있는 곳까지 깊이 탐색하다가 더 이상 탐색할 수 없을 때, 그 전의 정점으로 돌아가 다른 방향의 간선으로 탐색을 하는 순회방법이다. 탐색 과정에서 후입 선출 구조의 스택을 사용한다. 정점 A에서 탐색할 정점이 없으므로 스택을 pop하면, 스택이 공백이므로 깊이 우선 탐색을 종료한다. 깊이 우선 탐색으로 순회한 경로는 아래와 같다.

728x90