SetReplace icon indicating copy to clipboard operation
SetReplace copied to clipboard

Adding Hypergraph object

Open daneelsan opened this issue 3 years ago • 0 comments

Changes

  • Trying to solve #494.
  • Adding a basic Hypergraph object, accessors and upvalues.

Comments

  • Various designs questions:

    • ~How to represent the Hypergraph object in a notebook? Interpretation boxes (e.g. SparseArrays) or Graph-like plots?~ Decided on using a summary box.
    • ~The symbol Hyperedge is private for now. Should this be exposed?~ Decided to not use the symbol yet, just a list.
    • ~Should we consider hypergraphs with mixed types of Hyperedges? See https://github.com/maxitg/SetReplace/issues/494#issuecomment-720580460~ Decided to use "global" symmetries for now.
  • "ordered" was added (needs to be discussed) because many functions in WFR made the distinction. See:

    • https://resources.wolframcloud.com/FunctionRepository/resources/IsomorphicOrderedHypergraphQ/
    • https://resources.wolframcloud.com/FunctionRepository/resources/FindOrderedHypergraphIsomorphism/

ToDo

  • [ ] Fix HypergraphPlot
  • [ ] Plot the hypergraph if it is not big (in the summary box)
  • [ ] Tests
  • [ ] Documentation
  • [ ] More upvalues and/or redesign other functions to return Hypergraph (e.g. RandomHypergraph)

Examples

  • Create a random Hypergraph ("Ordered" by default):
(*In[]:=*) {8, 4} // RandomHypergraph // Hypergraph

image

  • Create a "Cyclic" Hypergraph:
(*In[]:=*) Hypergraph[{{1, 1, 1}}, True]

image

  • Some accessors:
hg = Hypergraph[{{}, {}, {1, 2, 3}}];

In[]:= EdgeList[hg]
Out[]= {{}, {}, {1, 2, 3}}

In[]:= VertexList[hg]
Out[]= {1, 2, 3}

In[]:= HypergraphSymmetry[hg]
Out[]= "Ordered"
  • Information:
(*In[]:= *) Information[Hypergraph]

image


This change is Reviewable

daneelsan avatar Jul 23 '21 16:07 daneelsan