Greedy algorithms try to find the optimal solution by taking the best available choice at every step. For example, you can greedily approach your life. You can always take the path that maximizes your happiness today. But that doesn't mean you'll be...
Markdown supported · ⌘↵ to post
Mario Cervera
Software craftsman. I write about Software Engineering (clean code, design, testing, ...) and also about Algorithms & Data Structures.
Nice article Jose!
Another way to describe your greedy solution for vertex cover is by finding a maximal matching in the graph and then taking all of its vertices. It's the same concept, just using another term of graph theory 😊
Another greedy approach for vertex cover that also works pretty well (although a bit less efficient) is repeatedly picking vertices of highest degree.