Results 1 to 1 of 1

Thread: depth-first search of a graph

  1. #1 depth-first search of a graph 
    New Member
    Join Date
    May 2013
    Hi!!! I need some help...
    The exercise is:
    You have to implement a data structure to represent graphs,directed or undirected,that tries to avoid the wasted space in the representation of a graph with adjacency matrix and the difficulty of searching the edges with adjacency list representation.
    We consider that the vertices are numbered from 1 to nverts and the exit degree of each vertex is at most MAXDEG. If deg[i] is the exit degree of the vertex i then the neighbors of the vertex i can be saved at the matrix edge[i][j], 1<=j<=deg[i].
    Write a program that reads the datas from a file: if the graph is directed or undirected(1 or 0), the number of vertices (nverts),the number of edges (nedges) and the first and the last vertex of each edge.
    Write the function dfs that, with argument the data structure that you implemented before for the representation of a graph, prints the edges by the depth-first search of a graph.

    What I've done so far is: I wrote a program that reads these information from a file, calculates the exit degree of each vertex and creates the matrix edge[i][j].

    What data structure do I have to implement???

    Reply With Quote  


Similar Threads

  1. Winding a solenoid several layers in depth
    By chekhonte in forum Physics
    Replies: 34
    Last Post: June 14th, 2013, 11:11 AM
  2. Bouyancy depth dependancy?
    By jakotaco in forum Physics
    Replies: 4
    Last Post: October 24th, 2010, 04:59 PM
  3. Replies: 2
    Last Post: November 8th, 2007, 12:39 AM
  4. The definition of in depth look
    By scientstphilosophertheist in forum Scientific Study of Religion
    Replies: 23
    Last Post: June 19th, 2007, 10:12 PM
  5. Depth perception difference between races?
    By Burger in forum Biology
    Replies: 1
    Last Post: April 25th, 2007, 07:01 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts