문제

let E - set of all edges in graph G The problem is to find the smallest subset S of vertices from G, which satisfies condition: sum of all outgoing edges from each vertex in S = E

In other words: Edges are streets and we can place street lamps on the vertices. If we place a street lamp on a vertex - all outgoing streets from this vertex are lightened. How to find the cheapes way to make all streets lightened?

Is there something better than backtracking?

도움이 되었습니까?

해결책

It is an np-complete problem. But as always there are many near optimal solutions. Try this one

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top