100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

CO2412 Computational Thinking Lecture 7 Notes

Rating
-
Sold
-
Pages
3
Uploaded on
20-08-2024
Written in
2023/2024

This document contains comprehensive notes from Lecture 7 of the CO2412 course on Computational Thinking. The lecture explores two important strategies for solving optimization problems: Greedy Algorithms and the Branch and Bound method. It provides an in-depth understanding of how these approaches work, their characteristics, and when to use them.

Show more Read less
Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Unknown
Course

Document information

Uploaded on
August 20, 2024
Number of pages
3
Written in
2023/2024
Type
Class notes
Professor(s)
Amin amini
Contains
All classes

Subjects

Content preview

CO2412: Computational Thinking
Lecture 7

The Greedy Algorithm
1. Introduction
o A greedy algorithm follows the problem-solving heuristic of making
the locally optimal choice at each stage with the hope of finding the
global optimum.
o Greedy algorithms are typically used for optimization problems.

2. Characteristics of Greedy Algorithms
o Local Optimization: The algorithm selects the best option
available at each step without considering the broader context.
o Greedy Choice Property: It assumes that by choosing the optimal
local solution, the global solution will also be optimal.
o Optimal Substructure: The problem can be broken down into
smaller subproblems, which can be solved optimally.
Fractional Knapsack Problem
1. Problem Statement
o The Fractional Knapsack problem involves a thief who can carry a
maximum weight in their knapsack. The goal is to maximize the
value of the knapsack by taking fractions of items.
2. Greedy Approach to Fractional Knapsack
o Items are selected based on the highest value-to-weight ratio.

o The item with the highest ratio is taken first, followed by the next,
and so on, until the knapsack is full.
Example:
$4.81
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
BpoBpo University of Central Lancashire Preston
Follow You need to be logged in order to follow users or courses
Sold
309
Member since
5 year
Number of followers
250
Documents
78
Last sold
1 month ago

3.7

73 reviews

5
27
4
17
3
17
2
5
1
7

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions