lab8_4904

2
 SRM DSA 2015 Lab. Assignment 8 Implement a directed graph using adjacency matrix implementation. Further, the user inputs  two vertices, one as source and other as destination, and  ‘k’ as number of edges The program should print all paths from source to destination that are covered in exactly k number of edges. The program must also print the c ount of such possible paths. For example consider the following graph. Let source be vertex 0, destination be 3 and k be 2. The output should be 2 as there are two walks from 0 to 3 with exactly 2 edges. The walks are {0, 2, 3} and {0, 1, 3}

Upload: akshaya-bhardwaj

Post on 01-Nov-2015

212 views

Category:

Documents


0 download

DESCRIPTION

knklnlk

TRANSCRIPT

  • SRM DSA 2015 Lab. Assignment 8

    Implement a directed graph using adjacency matrix implementation. Further, the user inputs

    two vertices, one as source and other as destination, and k as number of edges

    The program should print all paths from source to destination that are covered in exactly k number of edges. The program must also print the count of such possible paths. For example consider the following graph. Let source be vertex 0, destination be 3 and k be 2. The output should be 2 as there are two walks from 0 to 3 with exactly 2 edges. The walks are {0, 2, 3} and {0, 1, 3}