Skip to content

Commit e46eef4

Browse files
Término da implementação do Tópico. 9.1
1 parent 2136dcf commit e46eef4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Fad/Chapter9.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ def weight (e : Edge) : Weight := e.2.2
2121

2222
abbrev AdjArray := Lean.AssocList Vertex (List (Vertex × Weight))
2323

24+
abbrev Tree := Graph
25+
abbrev Forest := List Tree
26+
27+
def cost (t : Tree) : Int :=
28+
(edges t).map weight |>.sum
29+
2430

2531

2632
/- 9.4 Prim’s algorithm -/

0 commit comments

Comments
 (0)