Specification File adjacencyListGragh class GeneralGraph: use adjacency list to implement the graph which data structure is vector Construct methods: * public GeneralGraph(): contain an empty vector store the vertex and a boolean determines whether graph is directed or not, defaulted is undirected
标签: adjacencyListGragh Specification GeneralGraph adjacency
上传时间: 2013-12-13
上传用户:lyy1234
c pgm to find redundant paths in a graph.Many fault-tolerant network algorithms rely on an underlying assumption that there are possibly distinct network paths between a source-destination pair. Given a directed graph as input, write a program that uses depth-first search to determine all such paths. Note that, these paths are not vertex-disjoint i.e., the vertices may repeat but they are all edge-disjoint i.e., no two paths have the same edges. The input is the adjacency matrix of a directed acyclic graph and a pair(s) of source and destination vertices and the output should be the number of such disjoint paths and the paths themselves on separate lines. In case of multiple paths the output should be in order of paths with minimum vertices first. In case of tie the vertex number should be taken in consideration for ordering.
标签: fault-tolerant algorithms redundant underlyin
上传时间: 2013-12-18
上传用户:jkhjkh1982
Write a program to decide if a graph has a cycle or not. The given graph can be a directed or undirected graph, which is indicated at the time of reading the input (0 for directed graph and 1 for undirected graphs). The input is given as an adjacency list.
标签: graph directed program decide
上传时间: 2013-12-23
上传用户:cursor
Shortest Paths with Multiplicative Cost. In a given undirected graph, the path cost is measured as a product of all the edges in the path. The weights are rational numbers (e.g., 0.25, 0.75, 3.75 etc) or integers (2, 3). There are no negative edges. Given such a graph as input, you are to output the shortest path between any two given vertices. Input is the adjacency matrix and the two vertices. You must output the path.
标签: Multiplicative undirected Shortest measured
上传时间: 2017-04-08
上传用户:邶刖
In some graphs, the shortest path is given by optimizing two different metrics: the sum of weights of the edges and the number of edges. For example: if two paths with equal cost exist then, the path with the least number of edges is chosen as the shortest path. Given this metric, you have find out the shortest path between a given pair of vertices in the input graph. The output should be the number of edges on the path, the cost of the shortest path, and the path itself. Input is the adjacency matrix and the two vertices.
标签: optimizing different the shortest
上传时间: 2014-10-25
上传用户:1159797854
Edge Disjoint Cycles. You are given an input graph that is either directed or undirected. Write a program that reads in a vertex number and lists the number of edge disjoint cycles that start and end at this vertex. The output should also list the edges in each of the cycle discovered. Input will be the adjacency matrix preceded by a 0 or 1 representing Directed or Undirected graphs respectively.
标签: undirected Disjoint directed Cycles
上传时间: 2017-04-08
上传用户:13188549192