graphs Flashcards
types of problems
Decision problems: trying to decide whether a statement is true or false.
They have either yes or no as the solution.
Optimization problems: trying to find the solution with the best possible score according to some scoring scheme.
what are maxmization and minmisation problems
Maximization problems: trying to maximize a certain score.
Minimization problems: trying to minimize a cost function.
what is Optimization:
choosing the best element from a set of alternatives
For an optimization problem you want to find, ………, but the ………..
For an optimization problem you want to find, not just a solution, but the best solution.
what is optimization algorithm
is a numerical method or algorithm for finding a value x such that f(x) is as small (or as large) as possible, for a given function f, possibly with some constraints on x.
what types of algorthims we use For solving Optimization problems:
Greedy algorithm
Dynamic programming algorithm
Branch and bound algorithm(BFS)
what is the greedy algorthim way of solving a problem
give an example
by always making the choice that looks the best at the moment
-it makes locally optimal choices in hope that it will lead to glopal optimal solution
T or F: Greedy algorithms always yield optimal solutions
F
Greedy algorithms do not always yield optimal solutions, but for many problems they do.
Algorithms for optimization problems typically work as
a sequence of steps, with a set of choices at each step.
Examples of Greedy Algorithms :
Minimum-spanning-tree algorithms
Shortest path problems.
Travelling salesman problem.
The knapsack problem (items are divisible).
Task scheduling problem.
Huffman Coding.
T or F: The greedy method is quite powerful and works well for a wide range of problems.
T
what is a tree
connected undiractional graph with no cycle
problems like finding smallest , logest largest are …… problems and ……. algorthims can be used to solve them
problems like finding smallest , logest largest are optimazation problems and greedy algorthim algorthims can be used to solve them
what is spanning tree
A Spanning Tree of a graph G is a subgraph of G that is a tree and contains all the vertices of G
what are the spanning tree properties
1-a spanning tree of n vertix has n-1 edges
2-connected in all vertices
3-has no cycle