Master list Flashcards
Describe the travelling salesman problem.
You’re givn a graph of n cities with weighted, undirected edges. What is the shortest Hamiltonian cycle in the graph?
A Hamiltonian cycle is a graph cycle which starts in one city, travels through each other city exactly once, then finishes at the starting city.
What is the random construction method?
The random construction method is one where we generate a random permutation of all cities.
What is the iterative random construction method? How many times do we run it?
The iterative random method is one where we run the random method several times, then choose the best result.
It’s usually run 5 times, according to Nourddine.
What is the greedy construction method?
The greedy construction method is one where we start in a random city. At each step, we move to the next node with has the cheapest transition cost.
What is the random insertion method?
During each step in the random insertion method, we select a random city. We then try putting this in-between each other city in our current tour, to find out where it would cause the lowest increase in tour length.
What is the cheapest insertion method?
During each iteration:
1) Look at each unvisited city.
2) Try to insert it at any point in our current tour.
3) Select to keep the tour with the shortest length after doing this for all cities.
Describe the greedy improvement heuristic.
The greedy improvement heuristic takes some tour and tries to improve it by swapping cities pairwise. If the swap lowers the overall tour length, it’s accepted, otherwise it’s rejected.
The heuristic is run until some stopping criteria are met, and is usually bounded by:
- Time
- Number of iterations
- Rate of improvement over some window
Describe the transportation problem
It’s concerned with moving some commodity from a source to some destination.
We can model the problem as a list of factories (sources) with production rates, warehouses (destinations) with capacities and a weighted adjacency matrix between the two (transition costs).
Describe the northwest corner method.
With the northwest corner method, we start in the northwest corner.
We try to maximize how much is transported from the current factory to the current warehouse.
Afterwards, we continue to do this for each square on a zig-zag pattern towards the southeast corner.
Describe the least cost method. (Transportation)
In the least cost method, we look through the adjacency matrix to find the cheapest transition cost. We then want to transport as much as the factory/warehouse combination allows us.
Then we look through the adjacency matrix for the next cheapest factory/warehouse combination, and move as much as that allows.
We continue to do this while the factories and warehouses can deliver more.
Describe the stepping stone algorithm.
We ask ourselves: if we assign one more unit to some empty factory/warehouse combination, will this decrease the total cost?
We try doing this by adding 1 unit to some f/w combination. This will unbalance the adjacent row and column. To balance these, we remove one unit from the row/column (Typically from the most expensive f/w combination). This will make both of those unbalanced, so we need to balance both of those until an equilibrium has been reached.
Describe the knapsack problem.
Given an empty set with capacity W (the knapsack) and a set of items with value v and weight w. What items can we choose to maximize sum(v_i) subject to sum(w_i)
Describe the four construction methods centered around sorting the elements. (Knapsack)
We can sort by weight ascending and descending, and by value ascending and descending.
We then select items while the weight limit of the knapsack hasn’t been reached yet.
Describe how the greedy improvement heuristic can be used to improve this solution. (Knapsack)
We can iteratively choose to swap two item from outside/inside the knapsack and calculate the resulting cost. If it’s better, keep the swap. If it’s worse, reject the swap. Repeat until some stopping criteria has been reached.
Describe the kick method.
S1: Some initial solution. S2: Optimize S1. S3: Some randomization of S2 (Eg. k random swaps). S4: Optimize S3. Compare S2 and S4, keep the best.
Beskriv GreedyRandom.
GreedyRandom er en grådig optimeringsalgoritme som ligner på greedy heuristic.
Forskjellen er at man har en tilfeldig sjanse for å beholde nye løsninger man finner. Denne sjansen starter stor, og synker sakte gjennom hver deliterasjon av algoritmen.
Vis GreedyRandom i pseudokode.
http://imgur.com/a/6HE0P
Describe the graph partitioning problem
The graph partitioning problem is a problem in which we have a graph G(V,E), and two sets A and B.
We want to pot the nodes v in V into either A or B such that the edges crossing from A to B is minimized.
With v in V, what is E(v) = external(v) and I(v) = interal(v)? (Graph partitioning)
With some node v, E(v) are the edges crossing from v’s set to the other set.
I(v) are v’s edges connected to other nodes in v’s set.
With some v in V, what is diff(v)? (Graph partitioning)
diff(v) = external(v) - internal(v).
How do you interpret diff(v)? (Graph partitioning)
diff(v) is the difference between internal and external edges for some node. It tells us something about how much of an improvement we can expect when moving v to the other set.
Moving v to the other set might improve diff(v). Does it decrease diff(w) for w in V, v =/= w?
How do you improve this problem? (Graph partitioning)
You can exchange pairwise nodes a and b.