Algorithm Analysis (CSC 301 2015F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Outline] [EBoard] [Reading] [Lab] [Assignment]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference: [Algorist]
Related Courses: [Walker (2014F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker]
Overview
Order the edges by weight: O(mlogm)
For each edge, e, from largest to smallest: m edges (m times ...)
if removing edge e does not disconnect the graph, n+m for connectivity
remove edge e
O(m^2 + mn)
Add v to MST
While there are vertices not in the MST, O(n)
find the closest vertex and add it to the MST O(m) for obvious;
O(n) for clever
O(nm) or O(n^2)
Order the edges by weight: O(mlogm)
While the graph is disconnected
add the smallest edge between two non-connected components