Graph Theory (DP IB Applications & Interpretation (AI))

Flashcards

1/62

Enjoying Flashcards?
Tell us what you think

Cards in this collection (62)

  • What is a graph in the context of graph theory?

    A graph is a mathematical structure that is used to represent objects and the connections between them.

  • In the context of graph theory, what does a vertex in a graph represent?

    In the context of graph theory, a vertex in a graph can represent a place or an object.

  • In the context of graph theory, what does an edge in a graph represent?

    In the context of graph theory, an edge in a graph represents a connection between two vertices (places or objects).

  • What is used to indicate the number of edges that are connected to a specific vertex in a graph?

    The degree of a vertex is used to indicate the number of edges that are connected to a specific vertex in a graph.

  • In the context of graph theory, what the name of an edge that both starts and finishes at the same vertex?

    An edge that both starts and finishes at the same vertex is called a loop.

  • In the context of graph theory, define a complete graph.

    A complete graph is a graph in which each vertex is connected by an edge to each of the other vertices.

  • In the context of graph theory, what is a weighted graph?

    A weighted graph is a graph in which the edges are assigned numerical values.

    These numerical values could indicate distance or money, for example.

  • True or False?

    In the context of graph theory, the edges in a directed graph can only be travelled along in the direction indicated.

    True.

    The edges in a directed graph can only be travelled along in the direction indicated.

  • In the context of graph theory, what is a simple graph?

    A simple graph is undirected and unweighted and contains no loops or multiple edges.

  • True or False?

    In a connected graph it is possible to move along the edges and vertices to find a route between any two vertices.

    True.

    In a connected graph it is possible to move along the edges and vertices to find a route between any two vertices.

    If the graph is strongly connected, this route can be in either direction between the two vertices.

  • In the context of graph theory, what is a spanning tree?

    A spanning tree is a graph that contains all the vertices from a graph G and in which any two vertices are connected by exactly one path.

  • In the context of graph theory, what is an adjacency matrix?

    An adjacency matrix is a square matrix that can be used to show the number of direct connections between two vertices in a graph.

  • What does an entry of 0 in an adjacency matrix for a graph indicate?

    In an adjacency matrix for a graph, an entry of 0 indicates that there is no direct connection between the vertices indicated by corresponding row and column.

  • True or False?

    A directed graph will be symmetrical about the leading diagonal.

    False.

    A directed graph will not be symmetrical about the leading diagonal.

    However, an undirected graph will be symmetrical about the leading diagonal.

  • How is a loop indicated in the adjacency matrix of a graph?

    A loop indicated in the adjacency matrix of a graph by an entry along the leading diagonal.

    An entry of 1 in the leading diagonal indicates a loop in a directed graph.

    An entry of 2 in the leading diagonal indicates a loop in an undirected graph.

  • True or False?

    In a graph, the sum of the entries in a row is the out degree of that vertex.

    False.

    In a graph, the sum of the entries in a row is not the out degree of that vertex.

    The sum of the entries in a row is the in degree of that vertex.

    The sum of the entries in a column is the out degree of that vertex.

  • In the context of graph theory, what is a walk?

    A walk is a sequence of vertices that are visited when moving through a graph along its edges.

    Both edges and vertices can be revisited in a walk.

  • In the context of graph theory, how do you find the number of walks in a graph?

    If M denotes the adjacency matrix of a graph, then the (i, j) entry in the matrix Mk will give the number of walks of length k from vertex i to vertex j.

    E.g. if, M equals table row blank cell table row A B C D end table end cell row cell table row A row B row C row D end table end cell cell open square brackets table row cell space 0 space end cell cell 1 space end cell cell 0 space end cell cell 1 space end cell row cell space 1 space end cell cell 0 space end cell cell 1 space end cell cell 1 space end cell row cell space 0 space end cell cell 1 space end cell cell 0 space end cell cell 0 space end cell row cell space 1 end cell cell 1 space end cell cell 0 space end cell cell 0 space end cell end table close square brackets end cell end table, then M cubed equals table row blank cell table row A B C D end table end cell row cell table row A row B row C row D end table end cell cell open square brackets table row cell space 2 space end cell cell 4 space end cell cell 1 space end cell cell 3 space end cell row cell space 4 space end cell cell 2 space end cell cell 3 space end cell cell 4 space end cell row cell space 1 space end cell cell 3 space end cell cell 0 space end cell cell 1 space end cell row cell space 3 end cell cell 4 space end cell cell 1 space end cell cell 2 space end cell end table close square brackets end cell end table.

    So, there are 4 different walks of length 3 between the vertices A and B.

  • In the context of graph theory, what is a weighted adjacency table?

    A weighted adjacency table is an adjacency matrix where the value in each cell is the weight of the edge connecting that pair of vertices.

  • True or False?

    There may be different values in the two cells between a specific pair of vertices in a weighted adjacency table of a graph.

    True.

    For a directed graph there will be different values in the two cells between specific pairs of vertices in its weighted adjacency table.

    For an undirected graph the two cells between each pair of vertices will be the same.

  • What can be said about the symmetry within the weighted adjacency matrix for a directed graph?

    There is no symmetry along the leading diagonal in the weighted adjacency matrix for a directed graph.

  • In the context of graph theory, what is a minimum spanning tree?

    A minimum spanning tree is the spanning tree of least weight for a graph.

  • What are Kruskal's algorithm and Prim's algorithm used for?

    Kruskal's algorithm and Prim's algorithm are used to minimise the costs, materials or time of a situation that can be modelled by a graph.

    This minimisation is done by finding a minimum spanning tree of the graph.

  • True or False?

    Kruskal's algorithm can only be completed on a complete graph.

    True.

    Kruskal's algorithm can only be completed on a complete graph.

  • True or False?

    The number of edges in a minimum spanning tree will always be one more than the number of vertices in the graph.

    False.

    The number of edges in a minimum spanning tree will always be one less than the number of vertices in the graph.

  • What is a cycle?

    A cycle is a walk that starts at a given vertex and ends at the same vertex.

  • True or False?

    Kruskal's algorithm can be applied directly to a graph or to its adjacency matrix.

    False.

    Kruskal's algorithm can only be applied directly to a graph.

    Prim's algorithm, however, can be applied directly to a graph or to its adjacency matrix.

  • What are the steps involved in Kruskal's algorithm?

    The steps involved in Kruskal's algorithm are:

    1. Put the edges in ascending order of weight.

    2. Select the edge of least weight and add it to the minimum spanning tree.

    3. Select the next edge of least weight and add it to the tree (as long as it does not create a cycle with any previously selected edges).

    4. Repeat step 3 until all vertices in the graph are connected.

  • What are the steps involved in Prim's algorithm on a graph?

    The steps involved in Prim's algorithm on a graph are:

    1. Start at any vertex and choose the edge of least weight that is connected to it.

    2. Choose the edge of least weight that is connected)to any of the vertices already connected and does not connect to another vertex that is already in the tree.

    3. Repeat step 2 until all of the vertices are added to the tree.

  • What are the steps involved in Prim's algorithm on a matrix?

    The steps involved in Prim's algorithm on a matrix are:

    1. Select from an vertex, cross out the values in the column associated with that vertex and label the row associated with the vertex, 1

    2. Circle the lowest value in any cell along the row, adding the edge to the tree and crossing out the remaining values in its corresponding column.

    3. Label the row associated with the same vertex as the column in the previous step, with the next number.

    4. Circle the lowest value in any cell along any of the rows that have been labelled and add the edge to your tree, crossing out the remaining values in the column of the circled cell.

    5. Repeat STEPS 3 and 4 until all rows have been labelled and all vertices have been added to the tree.

  • Which algorithm, Prim's or Kruskal's is often considered to be more efficient?

    Prim's algorithm is often considered to be more efficient than Kruskal's algorithm, because:

    • the edges do not need to be ordered at the start,

    • and it is not necessary to check for cycles at every step.

  • In the context of graph theory, what is a trail?

    A trail is a walk in which no edge is repeated.

  • True or False?

    In graph theory, an Eulerian trail is a trail that visits each vertex in a graph exactly once.

    False.

    An Eulerian trail is a trail that visits each edge (not vertex) in a graph exactly once.

  • In the context of graph theory, what is a circuit?

    A circuit is a trail that begins and ends at the same vertex.

  • In the context of graph theory, what is an Eulerian circuit?

    An Eulerian circuit is a trail that visits each edge in a graph exactly once and begins and ends at the same vertex.

  • What can be said about the degree of each vertex in an Eulerian graph?

    In an Eulerian graph, the degree of each vertex is even.

  • What is the type of graph that contains an Eulerian trail but not an Eulerian circuit?

    A graph that contains an Eulerian trail but not an Eulerian circuit is known as a semi-Eulerian graph.

  • In a semi-Eulerian graph, where does an Eulerian trail start and finish?

    A semi-Eulerian contains exactly one pair of vertices that have an odd degree.

    These odd vertices are the start and finish points of any Eulerian trail.

  • What is the Chinese postman problem?

    The Chinese postman problem requires you to find the route of least weight that starts and finishes at the same vertex and traverses every edge in the graph.

  • True or False?

    If all of the vertices in a graph are even then the shortest route will be the sum of the weights of the edges in an Eulerian circuit.

    True.

    If all of the vertices in a graph are even then the shortest route will be the sum of the weights of the edges in an Eulerian circuit.

  • When solving the Chinese Postman problem, what must be done if a graph contains exactly one pair of odd vertices?

    If a graph contains exactly one pair of odd vertices, then the shortest route between those two vertices will need to be found and repeated on the graph before finding an Eulerian circuit.

  • In the Chinese Postman problem, if a graph contains 4 odd vertices how many possible pairings will there be?

    If a graph contains 4 odd vertices there will be 6 possible pairings.

    E.g. if vertices A, B, C and D are odd, you could have the following pairings:

    • AB + CD

    • AC + BD

    • AD + BC

  • In the context of graph theory, what is a path?

    A path is a walk in which no vertices are repeated.

  • In the context of graph theory, what is a Hamiltonian path?

    A Hamiltonian path is a path in which each vertex in a graph is visited exactly once.

  • In the context of graph theory, what is a hamiltonian cycle?

    A Hamiltonian cycle is a cycle which visits each vertex in a graph exactly once.

  • In the context of graph theory, what is a semi-Hamiltonian graph?

    A graph is Hamiltonian if it contains a Hamiltonian cycle but only semi-Hamiltonian if it contains a Hamiltonian path but not a Hamiltonian cycle.

  • True or False?

    There is an efficient algorithm to determine is a graph is Hamiltonian.

    False.

    There is no algorithm to determine is a graph is Hamiltonian.

    The only way to determine if a graph is Hamiltonian is to find a Hamiltonian cycle in it.

  • Define the travelling salesman problem.

    The travelling salesman problem requires you to find the route of least weight that starts and finishes at the same vertex and visits every other vertex in the graph exactly once.

  • In the classical travelling salesman problem, which two conditions must be met by a graph?

    In the classical travelling salesman problem, the two conditions that a a graph must meet are:

    1. The graph must be complete.

    2. The direct route between any two vertices must be the shortest route.

  • True or False?

    In a graph with 4 vertices, there will be 8 possible Hamiltonian cycles.

    False.

    In a graph with 4 vertices, there will be 6 possible Hamiltonian cycles.

    Consider a graph with vertices A, B, C and D, the 6 Hamiltonian cycles are:

    A B C D A
    A B D C A
    A C B D A
    A C D B A
    A D B C A
    A D C B A

  • What is the difference between the practical travelling salesman problem and the classical travelling salesman problem?

    Unlike the classical travelling salesman problem, the practical travelling salesman problem does not:

    • have a complete graph,

    • and/or its graph does not meet the triangle inequality (the direct route between two vertices being the shortest route).

  • How can the practical travelling salesman problem be converted to the classical travelling salesman problem?

    The practical travelling salesman problem be converted to the classical travelling salesman problem, by finding the table of least distances.

  • In the travelling salesman problem, what is a table of least distances?

    A table of least distances shows the shortest distance between any two vertices in a graph.

  • In the travelling salesman problem, how can the table of least distances be found?

    In the travelling salesman problem, the table of least distances be found by completing the following steps:

    1. In an empty weighted adjacency table, fill in the information for pairs of vertices that are adjacent in the graph.

      (At this stage check if the direct connections are actually the shortest route and if not, use the alternative shorter route.)

    2. Complete the rest of the table by finding the shortest route that can be travelled between each pair of vertices that are not adjacent.

  • True or False?

    The table of least values has a line of symmetry along the leading diagonal for an undirected graph.

    True.

    The table of least values has a line of symmetry along the leading diagonal for an undirected graph.

    This means that you only need to complete one half carefully first, then you can map over to the second half.

  • What is the nearest neighbour algorithm used for?

    The nearest neighbour algorithm can be used to find the upper bound for the minimum weight Hamiltonian cycle of a graph in the travelling salesman problem.

  • If there is more than one Hamiltonian cycle that can be found using the nearest neighbour algorithm, which cycle should be chosen as the upper bound of the travelling salesman problem?

    If there is more than one Hamiltonian cycle that can be found using the nearest neighbour algorithm, the cycle with the smallest value should be chosen as it will give the lowest upper bound.

  • What are the steps of the nearest neighbour algorithm?

    The steps of the nearest neighbour algorithm are:

    1. Choose a starting vertex.

    2. Follow the edge of least weight from the current vertex to an adjacent unvisited vertex.
      (If there is more than one edge of least weight pick one at random).

    3. Repeat step 2 until all vertices have been visited.

    4. Add the final edge to return to the starting vertex.

  • In the travelling salesman problem, what is the deleted vertex algorithm used for?

    The deleted vertex algorithm can be used to find the lower bound for the minimum weight Hamiltonian cycle of a graph in the travelling salesman problem.

  • If there is more than one Hamiltonian cycle that can be found using the deleted vertex algorithm, which cycle should be chosen as the lower bound of the travelling salesman problem?

    If there is more than one Hamiltonian cycle that can be found using the deleted vertex algorithm, the cycle with the greatest value should be chosen as it will give the highest lower bound.

  • What are the steps of the deleted vertex algorithm?

    The steps of the deleted vertex algorithm are:

    • Choose a vertex and delete it along with all edges that are connected to it.

    • Find the minimum spanning tree for the remaining graph.

    • Add the two shortest edges that were deleted from the original graph to the weight of the minimum spanning tree.

  • True or False?

    If you have found a cycle the same length as the upper bound then you have found the shortest route for the travelling salesman problem.

    False.

    If you have found a cycle the same length as the lower bound then you have found the shortest route for the travelling salesman problem.