SetReplace icon indicating copy to clipboard operation
SetReplace copied to clipboard

ConnectedHypergraphQ

Open daneelsan opened this issue 5 years ago • 0 comments

The problem

Determine whether a hypergraph is connected.

Possible solution

WFR:

ConnectedHypergraphQ[edges : {__List}] := 
 ConnectedGraphQ[
  Graph[UndirectedEdge @@@ 
    Catenate[Partition[#, 2, 1, -1] & /@ edges]]]
In[] := ResourceFunction["ConnectedHypergraphQ"][{{1, 1, 2}, {2, 3, 4}}]
Out[] = True

In[] := ResourceFunction["ConnectedHypergraphQ"][{{1, 1, 2}, {2, 3, 4}, {5, 6, 7}}]
Out[] = False

Additional context

This might be used in the Connected -> True option of RandomHypergraph.

daneelsan avatar Nov 09 '20 15:11 daneelsan