Vocab Flashcards
Algorithm
A finite sequence of step-by-step instructions carried out to solve a problem
Trace table
Used to record the values of each variable as the algorithm is run
Pros and Cons of First Fit Bin Packing
Pro: Quick and easy
Con: Is unlikely to generate the optimal solution
Optimal Solution
A solution that cannot be improved upon
Pros and Cons of First Fit Decreasing Bin Packing
Pro: Easy to implement; often generates a better solution than first fit.
Con: Doesn’t guarantee an optimal solution; the list first needs to be sorted into decreasing order which makes the problem more complex.
Pros and Cons of Full Bin Packing
Pro: Usually generates the optimal solution.
Con: Difficult, especially with long lists.
Efficiency of an algorithm
A measure of the run-time of the algorithm and is normally proportional to the number of operations that need to be carried out.
Size of the problem
A measure of the complexity of a problem. In sorting algorithms, it is usually the number of elements in the list.
Order of an algorithm (complexity)
A measure of the efficiency as a function of the size of the problem.
Graph
Consists of nodes/vertices that are connected by edges/arcs
Subgraph
A subgraph of G only contains edges and vertices that belong to G
Directed edges
Edges that have a direction associated with them
Digraph
A graph that contains 1 or more directed edges
Weight
Number associated with an edge
Weighted graph
A graph which only contains edges that have numbers associated with them (weights)
Degree/valency
The number of edges that are incident on a vertex
Odd vertex
A vertex of odd degree i.e. an odd number of edges is incident on it.
Even vertex
A vertex of even degree, i.e. an even number od edges is incident on it.
Euler’s Handshaking Lema
Every finite undirected graph has an even number of vertices of odd degree.
The sum of the valencies of all the vertices of a graph is equal to twice the total number of edges.
Path
A finite sequence of edges, where the end vertex of one edge is the start vertex of the next edge and no vertex appears more than once.
Cycle/Circuit
A closed path, i.e. the end vertex of the last edge is the start vertex of the first edge.
Simple graph
Contains no loops and there is at most 1 edge connecting a pair of vertices.
Hamiltonian cycle
A cycle that passes through every vertex of a graph
Walk
A finite sequence of edges such that the end vertex of one edge is the start vertex of the next edge
Tour
A walk that visits every vertex and returns to the start vertex