I have a graph with a int label and int cost associated with each edge. The graph is represented as...
araesqI have a graph with a int label and int cost associated with each edge. The graph is represented as an adjacency list. Given an int array, find a path through the graph that traces the values of the ints in the array while at the same time minimizing the cost acrued during the trace. That is, the first edge in the path should have a label that matches the array[0], and the second edge in the path should have a label that matches array[1], etc.... Any node may be the start. Parallel edges are allowed. An edge may be traversed more than once. Specifically: what is the fastest algorithm to both trace the given path and minimize the cost of the path? How should the labels and costs be represented in the adjacency list? Right now, I have basically a BFS, where the potential paths are kept in a priority list sorted by the total cost. Only edges that have labels that match the current index of the array (ie, the current path-label) are considered in the BFS. However, this seems rather slow as I'm optimizing for speed?
- 11 years ago
- 15
- Strategic Plan
- Tissue engineering has been called “an interdisciplinary field that applies the principles of engineering and life sciences toward the development...
- Operating system C programming
- what is an obtuse angle
- 9-2(4x+5) if x= -4
- How is conductivity of a substance related to the number of ions in that substance?
- What is the theme of The Five-Forty-Eight
- WHat are the principles of the cognitive level of analysis?
- you have been hired as a managerial accountant by Mr. Smith of Wilson-West Manufacturing a start up company that produces several different product lines.He would like you to set up the cost accounting system for the cabinet division.
- International Trade