Showing posts with label Efficient Algorithm. Show all posts
Showing posts with label Efficient Algorithm. Show all posts

Saturday, January 28, 2012

Optimal algorithm: Linear Programming

This week, i have learn about Linear Programming and using simplex algorithm
Linear programming (LP, or linear optimization) is a mathematical method for determining a way to achieve the best outcome (such as maximum profit or lowest cost) in a given mathematical model for some list of requirements represented as linear relationships. Linear programming is a specific case of mathematical programming (mathematical optimization).
[wikipedia]

Then I could give you some example, this is the popular problem called Diet Problem. The decision about how much of each food to buy (or eat) is to made entirely on dietary and economic considerations. And they will provide us the table of cost or nutrition stuff in order to support the question. Somehow if you ask me, i'll select my favorite first and eat them all. (LOL)

Last Thursday, I had chance to had a lunch with our lecturer and we were talking about some funny stuff in term of Duality. We discuss about how we should eat, should we eat the favorite food first or keep it for the last. My friend said, 'I'll save the best for the last'. I think this problem object to the maximum value, you eat them all but keep the best for the last. Then mine was different, I'll eat my favorite food first in order not to full at the last. So it might be object to minimum value. Subject to the quantity and quality of food. If save the best for the last is Primal, then eat the best first should be Dual for sure!

PS. don't believe my word this time, we just made fun because our optimization method teacher was with us that time. (LOL)

Wednesday, September 21, 2011

Longest Common Subsequence (LCS)

This is the presentation for Efficient algorithm about Longest common subsequence.

What is LCS?
The longest common subsequence (LCS) problem is to find the longest subsequence common to all sequences in a set of sequences (often just two).

The application of LCS is for finding the common in text string meaning that sometime it used for checking that the code from 2 source are the same or not (so crew for copy, right?) or finding the common in DNA if you want to find if someone is your relative or not (LOL).

How to do this?
Follow my slide is okay (haha): https://docs.google.com/leaf?id=0B-Ls4RhAgiHeMThmYTYxOWQtZTdkZi00NDNjLWI0NDUtZTllMDY0Y2RhMTM3&hl=en_US
For the flash slide to see step by step: Click the arrow at the bottom to see the step
View on ShareSWF you can download from this link: https://docs.google.com/leaf?id=0B-Ls4RhAgiHeMmY5MDZmZjItYTRlOS00ZDI5LTk1ZWEtNTU2NTEyZmNkOWMx&hl=en_US


good luck (my way)
Patama

Thursday, June 30, 2011

Heap sort

Hi, This morning I have to present about one of sorting algorithm. The algorithm that i selected was Heap sort. Why? Cuz this is the only one I can remember since I studied when i was freshmen. All I can remember is, there are binary tree that we can use for sorting algorithm. Then, it's Heap sort.
Here is my simple video to show you how heap sort working, I use Max-Heap method to show you how it's work. Hope you like it.

Here is my presentation file: https://docs.google.com/leaf?id=0B-Ls4RhAgiHeNDVkMzI4NDYtMDM1Zi00M2MwLThjN2MtMGJlZGZhYzg3YTQ2&hl=en_US&authkey=CJywhZgO