Comments (1)
크루스칼(Kruskal) 알고리즘
- 비용이 적은 간선부터 하나씩 선택하여 신장 트리를 만들어 가는 알고리즘
- 모든 간선을 비용 순으로 정렬한 다음 가중치 값이 작은 간선부터 차례대로 선택하여 신장 트리를 완성
문제 접근 방법
H = V(G)
입력 - 그래프 G ⇒ 불필요한 간선 제거 ⇒ 최소 비용 신장 트리 H 생성
- 노드만 남겨 두고 간선을 모두 제거한다.
- 가중치 값이 적은 간선부터 하나씩 추가. 가중치가 같은 간선일 경우 어느 간선을 선택해도 상관이 없다.
- 추가로 순환을 일으키지 않는 '최소 가중치' 간선인지 체크한다.
from coding-test.
Related Issues (5)
- Backtracking
- 공간복잡도, 시간복잡도
- 문제풀이방법, 팁 HOT 2
- Dynamic Programming 동적프로그래밍 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coding-test.