both fesibility&objective
The adjective greedy has the adverb form "greedily." It means done in a greedy or avaricious manner.
Because there are as many ways to be greedy as there are greedy people.
If you want to be greedy,well it means to have more than you need, never sharing .
Scrooge wasn't greedy as such. He was hard hearted and miserly
No. Greed is an addiction. People say "I'm greedy" or "I feel greedy" but really Greed is not a feeling, it is indeed an addiction.
Both are using Optimal substructure , that is if an optimal solution to the problem contains optimal solutions to the sub-problems
The optimal solution for the greedy knapsack problem is to choose items based on their value-to-weight ratio, selecting items with the highest ratio first until the knapsack is full. This approach maximizes the total value of items that can be placed in the knapsack.
The greedy algorithm for the knapsack problem involves selecting items based on their value-to-weight ratio, prioritizing items with the highest ratio first. This approach aims to maximize the value of items placed in the knapsack while staying within its weight capacity. By iteratively selecting the most valuable item that fits, the greedy algorithm can provide a near-optimal solution for the knapsack problem.
greedy method does not give best solution always.but divide and conquer gives the best optimal solution only(for example:quick sort is the best sort).greedy method gives feasible solutions,they need not be optimal at all.divide and conquer and dynamic programming are techniques.
Greedy algorithms are characterized by making the locally optimal choice at each step with the hope of finding a global optimum. They are typically efficient in terms of time complexity and are easier to implement compared to other algorithms. However, they do not always guarantee an optimal solution for all problems, as they may overlook better solutions that require making more complex decisions. Problems suitable for greedy algorithms often exhibit the properties of optimal substructure and greedy choice property.
The Reliance start chains of retail markets with turnover based approach by having very low margin and the items cheaper - quality, supply schedule, reliability, after sale service, personalised approach are the highlights which definetly throw out the middlemen, Dalals, greedy traders etc.
Greedy algorithms are simple to implement and easy to understand. They typically have a low time complexity, making them efficient for some problems. Greedy algorithms can provide quick solutions when the problem can be solved by making locally optimal choices.
The greedy algorithm is used in solving the set cover problem efficiently by selecting the best possible choice at each step without considering future consequences. This approach helps in finding a near-optimal solution quickly, making it a useful tool for solving optimization problems like set cover.
Greedy algorithms are only guaranteed to produce locally optimal solutions within a given time frame; they cannot be guaranteed to find globally optimal solutions. However, since the intent is to find a solution that approximates the global solution within a reasonable time frame, in that sense they will always work. If the intent is to find the optimal solution, they will mostly fail.
| Feature | Greedy Algorithm | Divide and Conquer | |------------------------|-------------------------------------------|--------------------------------------------| | Approach | Makes the best choice at each step | Divides the problem into smaller subproblems, solves them independently, and combines results | | Optimality | Does not guarantee an optimal solution | Often guarantees an optimal solution if applicable | | Problem Type | Suitable for optimization problems | Suitable for problems that can be broken down recursively | | Complexity | Generally has lower time complexity | Can have higher time complexity due to recursive calls and combining results |
Greedy algorithms are proven to be optimal through various techniques, such as the exchange argument and the matroid intersection theorem. One example is the proof of the greedy algorithm for the minimum spanning tree problem, where it is shown that the algorithm always produces a tree with the minimum weight. Another example is the proof of the greedy algorithm for the activity selection problem, which demonstrates that the algorithm always selects the maximum number of compatible activities. These proofs typically involve showing that the greedy choice at each step leads to an optimal solution overall.
Backtracking algorithmn finds minimal path among the all.The main advantage of back tracking algorithmn as compare with greedy is to find minimal distance.In greedy ,it does.t know the optimal solution.It is used in Google earth.