Skip to content

[EN] Implementation of Kruskal's algorithm / [FR] Implémentation de l'algorithme de Kruskal

License

Notifications You must be signed in to change notification settings

coursecomputer/kruskal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

Kruskal

[EN]
Implementation of Kruskal's algorithm

Kruskal is an algorithm that looks for the minimum weight coverage tree in a graph.

[FR]
Implémentation de l'algorithme de Kruskal

Kruskal est un algorithme qui recherche l'arbre couvrant de poids minimum dans un graphe.

Explanation

Pre-requisites

Before starting, please make sure you have installed:

  • python v3

Installation

# Download the repository
git clone https://github.com/coursecomputer/kruskal.git

Usage

CLI:

python3 -m unittest discover

CODE:

from source.graph import Graph

graph = Graph({
  "A": { "B": 3, "C": 6 },
  "B": { "A": 3, "C": 8 },
  "C": { "A": 6, "B": 8 },
})

graph.kruskal()
# [
#   ("A", "B", 3),
#   ("A", "C", 6),
# ]

Links

About

[EN] Implementation of Kruskal's algorithm / [FR] Implémentation de l'algorithme de Kruskal

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages