We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2136dcf commit e46eef4Copy full SHA for e46eef4
Fad/Chapter9.lean
@@ -21,6 +21,12 @@ def weight (e : Edge) : Weight := e.2.2
21
22
abbrev AdjArray := Lean.AssocList Vertex (List (Vertex × Weight))
23
24
+abbrev Tree := Graph
25
+abbrev Forest := List Tree
26
+
27
+def cost (t : Tree) : Int :=
28
+ (edges t).map weight |>.sum
29
30
31
32
/- 9.4 Prim’s algorithm -/
0 commit comments