Decision Maths Knowledge Flashcards
For a linear programming problem with slack variables, what are the basic variables?
Slack variables
What is the total float of an activity between i and j?
Float = late j - early i - duration
In flow charts, what does each box shape represent?
Pill shape - start/end
Rectangle - instruction
Diamond - Decision
How does bubble sort work?
Compare first two values, if in order, leave them, if notm swap them
Move onto 2nd and 3rd values until pass completed
List in order when a pass is completed with no swaps
How does quick sort work?
Select the middle value in the list as the pivot, move values to either side based on order
Middle value now in correct place
Select pivots for each side and repeat
What are the three bin packing algorithms?
First fit
First fit decreasing
Full bin
How does the first fit algorithm work for bin packing?
Take the items in the order given
Place each item in the first available bin that can take it (starting from bin 1)
What is the advantage and the disadvantage for the first fit algorithm for bin packing?
Advantage: Quick to implement
Disadvantage: Not likely to lead to a good solution
How does the first fit decreasing algorithm work for bin packing?
Sort the items into descending order
Apply the first fit algorithm to the reordered list
What are the advantages and the disadvantage for the first fit decreasing algorithm for bin packing?
Advantages: Fairly good solution & easy to implement
Disadvantages: May not get optimal solution
How does the full bin algorithm work for bin packing?
Use observation to find combinations that will fill a bin, pack these first
Any remaining are packed using first fit
What is the advantage and the disadvantage for the first fit decreasing algorithm for bin packing?
Advantage: Good solution
Disadvantage: Difficult when considering lots of items
What do the entries in an adjacency matrix show?
Describes the number of arcs joining the corresponding vertices
What value is obtained from an undirected loop in an adjacency matrix, and why?
2
Because it can be travelled in either direction
What do the entries in a distance matrix represent?
The weight of each arc joining the corresponding vertices
Outline the planarity algorithm
Identify a Hamiltonian cycle
Draw a polygon matching the Hamiltonian cycle
Draw edges inside the polygon to match those not represented by the polygon
List all edges inside the polygon
Choose any unlabelled edge and label it I for inside
Any that cross this inside edge label O for outside
Repeat for unlabelled edges
Planar if no edges cross
What is a minimum spanning tree?
A spanning tree such that the total length of its arcs is as small as possible
Outline Kruskal’s algorithm
Sort all arcs into ascending order of weight
Select the arc of least weight to start the tree
Consider the next arc: if it forms a cycle, reject it, if not, add it to the tree
Repeat until all vertices are connected
Outline Prim’s algorithm
Choose any vertex to start the tree
Select an arc of least weight that joins a vertex already in the tree to one not in the tree
Repeat until all vertices are connected
What are the three differences between Prim’s and Kruskal’s?
Prim’s consider vertices, Kruskal’s considers edges
Kruskal’s the graph is not always connected
Prim’s can be drawn from a distance matrix
What does Dijkstra’s algorithm find?
The shortest path between two nodes through a network
What does Floyd’s algorithm find?
The shortest path between every pair of vertices in a network
When using Floyd’s, what is put in place of there being no direct route between two vertices?
An infinity sign
What is the route inspection algorithm (Chinese postman) used to find?
Shortest route in a network that traverses every arc at least once and returns to its starting point
Outline route inspection algorithm
Identify vertices of odd degree
Consider all possible pairings of these vertices
Select the pairing that has the least sum
Add a repeat of the necessary arcs to the network
What is the best upper bound for travelling salesman?
Lowest possible value
What is the best lower bound for travelling salesman?
Highest possible value