SetReplace icon indicating copy to clipboard operation
SetReplace copied to clipboard

HypergraphSubstitutionSystem

Open daneelsan opened this issue 3 years ago • 0 comments

Changes

  • Implements HypergraphSubstitutionSystem, which uses the existing low-level Hypergraph-related code to compute the evolution of hypergraphs.
    • GenerateMultihistory generates a Multihistory object that contains a handle to the C++ instance, instead of an association representing the entire state of the "finished" object. This will allow us, in the future, to continue the evolution of multistory objects (see #436).
  • SetReplace* and WolframModel symbols now call GenerateMultihistory[HypergraphSubstitutionSystem[...], ...], and covert the resulting multihistory object to a {WolframModelEvolutionObject, 2}.

Comments

  • [ ] Tests

  • [ ] Documentation

Examples

In[] := {{1, 2, 3}, {2, 4, 5}, {4, 6, 7}} //
    GenerateMultihistory[
      HypergraphSubstitutionSystem[ToPatternRules[{{1, 2, 3}, {2, 4, 5}} -> {{5, 6, 1}, {6, 4, 2}, {4, 5, 3}}]],
      {"MaxGeneration" -> 5, "MaxDestroyerEvents" -> 1},
      None,
      {"ReverseSortedInputTokenIndices", "InputTokenIndices", "RuleIndex"},
      {}
    ] // SetReplaceTypeConvert[{WolframModelEvolutionObject, 2}] //
      #["ExpressionsEventsGraph", VertexLabels -> "Index"] &
Example

This change is Reviewable

daneelsan avatar May 12 '21 15:05 daneelsan