Code Monkey home page Code Monkey logo

Comments (1)

ttobaegi avatar ttobaegi commented on June 21, 2024

크루스칼(Kruskal) 알고리즘

  • 비용이 적은 간선부터 하나씩 선택하여 신장 트리를 만들어 가는 알고리즘
  • 모든 간선을 비용 순으로 정렬한 다음 가중치 값이 작은 간선부터 차례대로 선택하여 신장 트리를 완성

문제 접근 방법

H = V(G)

입력 - 그래프 G ⇒ 불필요한 간선 제거 ⇒ 최소 비용 신장 트리 H 생성

  1. 노드만 남겨 두고 간선을 모두 제거한다.
  2. 가중치 값이 적은 간선부터 하나씩 추가. 가중치가 같은 간선일 경우 어느 간선을 선택해도 상관이 없다.
  3. 추가로 순환을 일으키지 않는 '최소 가중치' 간선인지 체크한다.

from coding-test.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.