All Projects → maxitg → Setreplace

maxitg / Setreplace

Licence: mit
Wolfram Language Package for exploring Set and Hypergraph Substitution Systems

Projects that are alternatives of or similar to Setreplace

Learningmasteringalgorithms C
Mastering Algorithms with C 《算法精解:C语言描述》源码及Xcode工程、Linux工程
Stars: ✭ 615 (+333.1%)
Mutual labels:  graph, set
Javascript Datastructures Algorithms
📚 collection of JavaScript and TypeScript data structures and algorithms for education purposes. Source code bundle of JavaScript algorithms and data structures book
Stars: ✭ 3,221 (+2168.31%)
Mutual labels:  graph, set
Arduino Plotter
An Arduino library for easy graphing on host computer via serial communication
Stars: ✭ 129 (-9.15%)
Mutual labels:  graph
Question Pairs Matching
第三届魔镜杯 智能客服问题相似性算法设计 第12名解决方案
Stars: ✭ 138 (-2.82%)
Mutual labels:  graph
Blockchain2graph
Blockchain2graph extracts blockchain data (bitcoin) and insert them into a graph database (neo4j).
Stars: ✭ 134 (-5.63%)
Mutual labels:  graph
Reddit Detective
Play detective on Reddit: Discover political disinformation campaigns, secret influencers and more
Stars: ✭ 129 (-9.15%)
Mutual labels:  graph
Cp
(unofficial) Chipmunk2D in Go, no dependencies
Stars: ✭ 135 (-4.93%)
Mutual labels:  physics
Xnode
Unity Node Editor: Lets you view and edit node graphs inside Unity
Stars: ✭ 2,077 (+1362.68%)
Mutual labels:  graph
Sparkling Graph
SparklingGraph provides easy to use set of features that will give you ability to proces large scala graphs using Spark and GraphX.
Stars: ✭ 139 (-2.11%)
Mutual labels:  graph
Goimportdot
A tiny tool to draw a graph of golang package import relationship
Stars: ✭ 134 (-5.63%)
Mutual labels:  graph
Wannier tools
WannierTools: An open-source software package for novel topological materials. Full documentation:
Stars: ✭ 136 (-4.23%)
Mutual labels:  physics
Codeatlasvsix
A graph-based code navigation plugin for Visual Studio
Stars: ✭ 133 (-6.34%)
Mutual labels:  graph
Espresso
The ESPResSo package
Stars: ✭ 130 (-8.45%)
Mutual labels:  physics
Galpy
Galactic Dynamics in python
Stars: ✭ 134 (-5.63%)
Mutual labels:  physics
Npmcharts.com
Compare npm package downloads over time
Stars: ✭ 129 (-9.15%)
Mutual labels:  graph
Urbanaccess
A tool for GTFS transit and OSM pedestrian network accessibility analysis
Stars: ✭ 137 (-3.52%)
Mutual labels:  graph
Asciigraph
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
Stars: ✭ 1,805 (+1171.13%)
Mutual labels:  graph
Phaser Examples
Contains hundreds of source code examples and related media for the Phaser HTML5 Game Framework.
Stars: ✭ 1,680 (+1083.1%)
Mutual labels:  physics
Sonic
🦔 Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.
Stars: ✭ 12,347 (+8595.07%)
Mutual labels:  graph
Bornmay
Awesome Github Profile Readme. Github ReadMe Github Profile Readme Dynamic Github ReadMe Dynamic Github Profile ReadMe. Please Star and Fork
Stars: ✭ 140 (-1.41%)
Mutual labels:  physics

Discord

Wolfram Models as Set Substitution Systems | Getting Started | Symbols and Functions | Physics | Acknowledgements

Wolfram Models as Set Substitution Systems

Set Substitution Systems

SetReplace is a Wolfram Language package for manipulating set substitution systems. To understand what a set substitution system does consider an unordered set of elements:

{1, 2, 5, 3, 6}

We can set up an operation on this set which would take any of the two elements and replace them with their sum:

{a_, b_} :> {a + b}

In SetReplace, this can be expressed as the following (the new element 1 + 2 -> 3 is put at the end)

In[] := SetReplace[{1, 2, 5, 3, 6}, {a_, b_} :> {a + b}]
Out[] = {5, 3, 6, 3}

Note that this is similar to SubsetReplace function of Wolfram Language (introduced in version 12.1, it replaces all non-overlapping subsets at once by default):

In[] := SubsetReplace[{1, 2, 5, 3, 6}, {a_, b_} :> a + b]
Out[] = {3, 8, 6}

Wolfram Models

A more interesting case (which we call a Wolfram model) is one where the set elements are related to each other. Specifically, we can consider a set of ordered lists of atomic vertices; in other words, an ordered hypergraph.

As an example consider a set:

{{1, 2, 3}, {2, 4, 5}, {4, 6, 7}}

We can render it as a collection of ordered hyperedges:

In[] := HypergraphPlot[{{1, 2, 3}, {2, 4, 5}, {4, 6, 7}},
 VertexLabels -> Automatic]

We can then have a rule which would pick a subset of these hyperedges related through common vertices (much like a join query) and replace them with something else:

{{v1_, v2_, v3_}, {v2_, v4_, v5_}} :>
 Module[{v6}, {{v5, v6, v1}, {v6, v4, v2}, {v4, v5, v3}}]

Note the Module on the right-hand side creates a new variable (vertex) which causes the hypergraph to grow. Due to optimizations, it's not always a Module that creates vertices, so its name may be different. After a single replacement we get this (the new vertex is v11):

In[] := HypergraphPlot[SetReplace[{{1, 2, 3}, {2, 4, 5}, {4, 6, 7}},
  {{v1_, v2_, v3_}, {v2_, v4_, v5_}} :>
   Module[{v6}, {{v5, v6, v1}, {v6, v4, v2}, {v4, v5, v3}}]],
 VertexLabels -> Automatic]

After 10 steps, we get a more complicated structure:

In[] := HypergraphPlot[SetReplace[{{1, 2, 3}, {2, 4, 5}, {4, 6, 7}},
  {{v1_, v2_, v3_}, {v2_, v4_, v5_}} :>
   Module[{v6}, {{v5, v6, v1}, {v6, v4, v2}, {v4, v5, v3}}], 10],
 VertexLabels -> Automatic]

And after 100 steps, it gets even more elaborate:

In[] := HypergraphPlot[SetReplace[{{1, 2, 3}, {2, 4, 5}, {4, 6, 7}},
  {{v1_, v2_, v3_}, {v2_, v4_, v5_}} :>
   Module[{v6}, {{v5, v6, v1}, {v6, v4, v2}, {v4, v5, v3}}], 100]]

Exploring the hypergraph models of this variety is the primary purpose of this package.

Getting Started

Dependencies

You only need three things to use SetReplace:

  • Windows, macOS 10.12+, or Linux.
  • Wolfram Language 12.2+ including WolframScript. A free version is available as Wolfram Engine.
  • A C++17 compiler to build the low-level part of the package. Instructions on how to set up a compiler to use in WolframScript are here.

Build Instructions

For users who wish to make use of SetReplace functionality, and not modify the source code itself, we recommend simply building and installing the paclet.

To do this, run the following on the command line:

cd ~/PATH-TO-CHECKOUT/SetReplace
./install.wls

Please note that if you do not have GitLink installed, it will be installed for you.

Now that you have installed the SetReplace paclet, you should evaluate << SetReplace` every time you start a fresh Mathematica session. This will load the paclet and bring the various functions into scope, so that you can call them.

For more info about doing development on the SetReplace codebase and the associated workflows, see the Contributing guide.

C++17

If, while building, you see an error message about C++17, make sure the C++ compiler you are using is up-to-date. If your default system compiler does not support C++17, you can choose a different one with environmental variables. The following, for instance, typically works on a Mac:

COMPILER=CCompilerDriver\`ClangCompiler\`ClangCompiler COMPILER_INSTALLATION=/usr/bin ./install.wls

Here ClangCompiler can be replaced with one of << CCompilerDriver`; "Compiler" /. CCompilerDriver`CCompilers[Full] , and COMPILER_INSTALLATION is a directory in which the compiler binary can be found.

Contributing

Keep in mind that this is an active research project. While we try to keep the main functionality backward compatible, it might change in the future as we adjust our models and find better ways of analysis. Keep that in mind when building on top of SetReplace, and keep track of git SHAs as you go.

SetReplace is an open-source project, and everyone is welcome to contribute. Read our contributing guidelines to get started.

We have a Discord server. If you would like to contribute but have questions or don't know where to start, this is the perfect place! In addition to helping new contributors, we discuss feature and research ideas. So, if you are interested, please join!

Symbols and Functions

Physics

A hypothesis is that spacetime at small scales is a network, and the fundamental law of physics is a system similar to the one this package implements.

A slightly different version of this system was first introduced in Stephen Wolfram' s A New Kind Of Science.

Acknowledgements

In additional to commit authors and reviewers, Stephen Wolfram has contributed to the API design of some functions, and Jeremy Davis has contributed to the visual style of HypergraphPlot , RulePlot and "CausalGraph" .

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].