diff_months: 17

Graph Algorithm Assignment

Download Solution Now
Added on: 2023-03-01 05:57:58
Order Code: 220assig2
Question Task Id: 0
  • Country :


1. (30%) Consider the digraph whose nodes are numerically labelled 0,1,..., 6 and whose adjacency matrix is given below.

Carry out the depth first search algorithm, as given in class, on this digraph. You must follow the following rules EXACTLY.

  • In every for loop, process nodes in order of increasing numerical label.
  • Immediately before each call to DFSvisit, list all nodes that have been visited, all that are unvisited, and all that have finished being processed.
  • Describe the depth-first forest. List all tree ares, cross ares, forward arcs and back arcs. Give the times when each node was first seen and when it was completed.

See the formatting section below for the rules on how your answer should look.

2. (70%) This question concerns some extra properties of connected graphs that were not covered in the coursebook or in lectures.
Let G be a connected graph. A vertex of G is called an articulation point (or cutpoint) of G if when we delete v (and all edges incident to v), the resulting graph is not connected.
G is called biconnected if it has no articulation points. It is a theorem that in a biconnected graph, for each pair of vertices and w, there are at least two paths from to w, and the only nodes these paths have in common aree and themselves.

REQUIREMENT: Modify depth-first search to produce an algorithm that will determine whether a graph is biconnected. Implement your algorithm as follows. The program must take an input file of the format shown below. All the digraphs given will be symmetrie (so they represent graphs in the obvious way) and your program need not check this. However the input may not be connected, and your program does need to check this somehow. The program must output a file of the form shown below.

Hint: Consider DFSV run from a fixed root v, producing a tree T. If a vertex z v is not an articulation point, and y is a child of r in T, then there must be a path in G from p to an ancestor of z which does not use only tree edges. This tells you something important about back edges that can be checked by looking at timestamps. If itself is an articulation point, then you must reason differently. All the necessary information can be collected while DFSv is running

Input and output formatting

For Q1, your answer should be a file answere2.txt with exactly the same format as the file sampleq1.txt in my 220 handouts directory.
For Q2, the input format is as in the examples of Appendix B of the coursebook. Here is a more formal description of that format. An input file consists of a certain number of files appended one after the other, followed by a file consisting of a single line whose only entry is the character 0. Each of the small files is an adjacency list for a digraph and has the following form. The first line gives the order n of the digraph. There are n more lines. The ith of these consists of a list of neighbours of node i -1 (we assume the nodes are labelled 0, 1,..., -1), with successive elements separated by a space.

Example: a digraph with 4 nodes followed by one with 8 nodes followed by one with 3 nodes. All are symmetric and so can be used for Q2 above (we think of them as graphs).


The output format is simple; for the given input it is:
Graph 1: not biconnected
Graph 2: biconnected Graph 3: not connected

The program in Q2 will be tested against a file containing about 50 random graphs. The markers will check the output with a text comparison program, so it must be in EXACTLY the right format as described above.

Get your Graph Algorithm assignment solved by our Mathematics Experts from Exam Question Bank . Our Assignment Writing Experts are efficient to provide a fresh solution to all question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing Style. Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered.

You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turn tin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

  • Uploaded By : Katthy Wills
  • Posted on : March 01st, 2023
  • Downloads : 0
  • Views : 193

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan


80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing


30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%


20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more