-1

Let's say I have a graph,

enter image description here

and from this graph I want to create a circuit K whose inputs can be set so that K outputs true iff the graph has an independent set of size ≥2. I've seen some decent stuff on the internet / youtube about how to go about this. But I was wondering if there is a standard set of steps one should follow on how to do this.

My thought process was sort of: Have the circuit take edges as input, and output 1 (true) if at least one edge is missing (as this edge is an independent set).

But if i'm being honest i'm having a hard time wrapping my head around this.

David Dennis
  • 702
  • 2
  • 9
  • 26
  • Please clarify: your only circuit in this graph is ABC, which does not contain any independent set of two nodes. The graph as a whole has only one such set, {B, D}, but those are not part of any circuit. – Prune May 01 '18 at 16:23
  • Also, please discuss your work so far; your empty allusion to your research doesn't help *us* focus the problem. – Prune May 01 '18 at 16:23

1 Answers1

0

Your approach is correct in concept, but there's an even easier way: count the edges in the graph. For N nodes, if |E| < N * (N-1) / 2, then you have at least one independent set of size >= 2. All it takes is one missing edge, as you've noted.

To find the largest independent set, there's a transformation trick that's relatively easy in concept: Invert the graph: switch all non-edges and edges. For instance, your posted graph contains 4 of the possible 6 edges. Invert this, so your graph edges are only DB and DC.

Take the resulting graph and find the largest clique (there's plenty of material on this). That largest clique is the largest independent graph.

Prune
  • 76,765
  • 14
  • 60
  • 81