Mathematical algorithm for graphs

20 Views Asked by At

I would like to make a computer program that would give the fewest number of nodes needed to make a graph traversable. When a node is 'on' all the arcs coming off it are reachable until the next node. If this node is 'on' then all the arcs coming off this are reachable etc. If a node is 'off', and arcs between it and another 'off' node are not reachable.

My question is, is there a mathematical algorithm that I could use to make this in a program? I was thinking maybe Primm's but this is to make all the nodes reachable, not the arcs.

1

There are 1 best solutions below

0
On

I believe your are talking about the Vertex Cover problem, which is unfortunately $NP$-complete.