---
title: Graph Notation
date: '2025-08-15'
words: 534
collection: ramblings
---

Expressing graphs is a useful thing to be able to do. Most libraries I've seen
in the past give you a way to declare _nodes_ and _edges_ directly. In some
applications this is the most natural way to express the graph, when edges are
somewhat ad-hoc.

However, when working on a design for Secure Multiparty Computations we often
needed a way to express graphs with more global notions of
_fully-connectedness_. This got me thinking... could we use that as a primitive
to build arbitrary graphs? The answer appears to be yes!

#### Fully Connected Graphs

Sets of fully connected nodes are denoted with `{}`, for example the
following shows a simple fully-connected graph of four nodes.

```graph
G = {A, B, C, D}
```


<figure class="tikz"><svg role="img" aria-label="A fully connected graph of four nodes, A, B, C and D" version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='11.2337em' height='11.2337em' viewBox='-72 -72 112.336996 112.336996'> <defs> <path id='tikz-c7f1f258-g0-65' d='M3.965131-6.933998C3.915318-7.063512 3.895392-7.13325 3.73599-7.13325S3.5467-7.073474 3.496887-6.933998L1.43462-.976339C1.255293-.468244 .856787-.318804 .318804-.308842V0C.547945-.009963 .976339-.029888 1.334994-.029888C1.643836-.029888 2.161893-.009963 2.480697 0V-.308842C1.982565-.308842 1.733499-.557908 1.733499-.816936C1.733499-.846824 1.743462-.946451 1.753425-.966376L2.211706-2.271482H4.672478L5.200498-.747198C5.210461-.707347 5.230386-.647572 5.230386-.607721C5.230386-.308842 4.672478-.308842 4.403487-.308842V0C4.762142-.029888 5.459527-.029888 5.838107-.029888C6.266501-.029888 6.724782-.019925 7.143213 0V-.308842H6.963885C6.366127-.308842 6.22665-.37858 6.117061-.707347L3.965131-6.933998ZM3.437111-5.818182L4.562889-2.580324H2.321295L3.437111-5.818182Z'/> <path id='tikz-c7f1f258-g0-66' d='M2.211706-3.646326V-6.097136C2.211706-6.425903 2.231631-6.495641 2.699875-6.495641H3.935243C4.901619-6.495641 5.250311-5.648817 5.250311-5.120797C5.250311-4.483188 4.762142-3.646326 3.656289-3.646326H2.211706ZM4.562889-3.556663C5.529265-3.745953 6.216687-4.383562 6.216687-5.120797C6.216687-5.987547 5.300125-6.804483 4.004981-6.804483H.358655V-6.495641H.597758C1.364882-6.495641 1.384807-6.386052 1.384807-6.027397V-.777086C1.384807-.418431 1.364882-.308842 .597758-.308842H.358655V0H4.26401C5.589041 0 6.485679-.886675 6.485679-1.823163C6.485679-2.689913 5.668742-3.437111 4.562889-3.556663ZM3.945205-.308842H2.699875C2.231631-.308842 2.211706-.37858 2.211706-.707347V-3.427148H4.084682C5.070984-3.427148 5.489415-2.500623 5.489415-1.833126C5.489415-1.125778 4.971357-.308842 3.945205-.308842Z'/> <path id='tikz-c7f1f258-g0-67' d='M.557908-3.407223C.557908-1.344956 2.171856 .219178 4.024907 .219178C5.648817 .219178 6.625156-1.165629 6.625156-2.321295C6.625156-2.420922 6.625156-2.49066 6.495641-2.49066C6.386052-2.49066 6.386052-2.430884 6.37609-2.331258C6.296389-.9066 5.230386-.089664 4.144458-.089664C3.536737-.089664 1.58406-.428394 1.58406-3.39726C1.58406-6.37609 3.526775-6.714819 4.134496-6.714819C5.220423-6.714819 6.107098-5.808219 6.306351-4.353674C6.326276-4.214197 6.326276-4.184309 6.465753-4.184309C6.625156-4.184309 6.625156-4.214197 6.625156-4.423412V-6.784558C6.625156-6.953923 6.625156-7.023661 6.515567-7.023661C6.475716-7.023661 6.435866-7.023661 6.356164-6.90411L5.858032-6.166874C5.489415-6.525529 4.98132-7.023661 4.024907-7.023661C2.161893-7.023661 .557908-5.439601 .557908-3.407223Z'/> <path id='tikz-c7f1f258-g0-68' d='M.348692-6.804483V-6.495641H.587796C1.354919-6.495641 1.374844-6.386052 1.374844-6.027397V-.777086C1.374844-.418431 1.354919-.308842 .587796-.308842H.348692V0H3.995019C5.668742 0 7.043587-1.474471 7.043587-3.347447C7.043587-5.240349 5.69863-6.804483 3.995019-6.804483H.348692ZM2.719801-.308842C2.251557-.308842 2.231631-.37858 2.231631-.707347V-6.097136C2.231631-6.425903 2.251557-6.495641 2.719801-6.495641H3.716065C4.333748-6.495641 5.021171-6.276463 5.529265-5.569116C5.957659-4.98132 6.047323-4.124533 6.047323-3.347447C6.047323-2.241594 5.858032-1.643836 5.499377-1.155666C5.300125-.886675 4.732254-.308842 3.726027-.308842H2.719801Z'/> </defs> <g id='tikz-c7f1f258-page1'> <g stroke-miterlimit='10' transform='matrix(.996264 0 0 -.996264 -58.35116 26.688173)' fill='currentColor' stroke='currentColor' stroke-width='0.4'> <path d='M12.50002 85.35823C12.50002 92.26189 6.90366 97.85825 0 97.85825S-12.50002 92.26189-12.50002 85.35823S-6.90366 72.85822 0 72.85822S12.50002 78.45457 12.50002 85.35823ZM0 85.35823' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 54.819977 108.729824)' stroke='none' fill='currentColor'> <use x='-58.35116' y='26.688173' xlink:href='#tikz-c7f1f258-g0-65'/> </g> <path d='M97.85825 85.35823C97.85825 92.26189 92.26189 97.85825 85.35823 97.85825S72.85822 92.26189 72.85822 85.35823S78.45457 72.85822 85.35823 72.85822S97.85825 78.45457 97.85825 85.35823ZM85.35823 85.35823' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 140.386537 108.729824)' stroke='none' fill='currentColor'> <use x='-58.35116' y='26.688173' xlink:href='#tikz-c7f1f258-g0-66'/> </g> <path d='M12.50002 0C12.50002 6.90366 6.90366 12.50002 0 12.50002S-12.50002 6.90366-12.50002 0S-6.90366-12.50002 0-12.50002S12.50002-6.90366 12.50002 0ZM0 0' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 54.958867 23.371594)' stroke='none' fill='currentColor'> <use x='-58.35116' y='26.688173' xlink:href='#tikz-c7f1f258-g0-67'/> </g> <path d='M97.85825 0C97.85825 6.90366 92.26189 12.50002 85.35823 12.50002S72.85822 6.90366 72.85822 0S78.45457-12.50002 85.35823-12.50002S97.85825-6.90366 97.85825 0ZM85.35823 0' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 140.108767 23.371594)' stroke='none' fill='currentColor'> <use x='-58.35116' y='26.688173' xlink:href='#tikz-c7f1f258-g0-68'/> </g> <path d='M12.70154 0H72.66707' fill='none'/> <path d='M85.37074 72.66728L85.36996 12.70135' fill='none'/> <path d='M8.98174 76.38826L76.38805 8.98174' fill='none'/> <path d='M76.38727 76.38727L8.98134 8.98134' fill='none'/> <path d='M0 72.66707V12.70154' fill='none'/> <path d='M12.70135 85.37074L72.66728 85.36996' fill='none'/> </g> </g> </svg></figure>


We can nest expressions within each other:

```graph
G = { {A, B}, {C, D} }
```

The two examples above are equivalent, however it may be useful to label
specific groups of nodes anyway.

```graph
X = {A, B}
Y = {C, D}
G = {X, Y} = {A, B, C, D}
```

#### Fully Disconnected Graphs

We can also define fully disconnected graphs with `[]`.

```graph
G = [A, B, C, D]
  = [[A, B], [C, D]]
```


<figure class="tikz"><svg role="img" aria-label="Four disconnected nodes, A, B, C and D" version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='28.2416em' height='2.7298em' viewBox='-72 -72 282.415751 27.297654'> <defs> <path id='tikz-d97cedc2-g0-65' d='M3.965131-6.933998C3.915318-7.063512 3.895392-7.13325 3.73599-7.13325S3.5467-7.073474 3.496887-6.933998L1.43462-.976339C1.255293-.468244 .856787-.318804 .318804-.308842V0C.547945-.009963 .976339-.029888 1.334994-.029888C1.643836-.029888 2.161893-.009963 2.480697 0V-.308842C1.982565-.308842 1.733499-.557908 1.733499-.816936C1.733499-.846824 1.743462-.946451 1.753425-.966376L2.211706-2.271482H4.672478L5.200498-.747198C5.210461-.707347 5.230386-.647572 5.230386-.607721C5.230386-.308842 4.672478-.308842 4.403487-.308842V0C4.762142-.029888 5.459527-.029888 5.838107-.029888C6.266501-.029888 6.724782-.019925 7.143213 0V-.308842H6.963885C6.366127-.308842 6.22665-.37858 6.117061-.707347L3.965131-6.933998ZM3.437111-5.818182L4.562889-2.580324H2.321295L3.437111-5.818182Z'/> <path id='tikz-d97cedc2-g0-66' d='M2.211706-3.646326V-6.097136C2.211706-6.425903 2.231631-6.495641 2.699875-6.495641H3.935243C4.901619-6.495641 5.250311-5.648817 5.250311-5.120797C5.250311-4.483188 4.762142-3.646326 3.656289-3.646326H2.211706ZM4.562889-3.556663C5.529265-3.745953 6.216687-4.383562 6.216687-5.120797C6.216687-5.987547 5.300125-6.804483 4.004981-6.804483H.358655V-6.495641H.597758C1.364882-6.495641 1.384807-6.386052 1.384807-6.027397V-.777086C1.384807-.418431 1.364882-.308842 .597758-.308842H.358655V0H4.26401C5.589041 0 6.485679-.886675 6.485679-1.823163C6.485679-2.689913 5.668742-3.437111 4.562889-3.556663ZM3.945205-.308842H2.699875C2.231631-.308842 2.211706-.37858 2.211706-.707347V-3.427148H4.084682C5.070984-3.427148 5.489415-2.500623 5.489415-1.833126C5.489415-1.125778 4.971357-.308842 3.945205-.308842Z'/> <path id='tikz-d97cedc2-g0-67' d='M.557908-3.407223C.557908-1.344956 2.171856 .219178 4.024907 .219178C5.648817 .219178 6.625156-1.165629 6.625156-2.321295C6.625156-2.420922 6.625156-2.49066 6.495641-2.49066C6.386052-2.49066 6.386052-2.430884 6.37609-2.331258C6.296389-.9066 5.230386-.089664 4.144458-.089664C3.536737-.089664 1.58406-.428394 1.58406-3.39726C1.58406-6.37609 3.526775-6.714819 4.134496-6.714819C5.220423-6.714819 6.107098-5.808219 6.306351-4.353674C6.326276-4.214197 6.326276-4.184309 6.465753-4.184309C6.625156-4.184309 6.625156-4.214197 6.625156-4.423412V-6.784558C6.625156-6.953923 6.625156-7.023661 6.515567-7.023661C6.475716-7.023661 6.435866-7.023661 6.356164-6.90411L5.858032-6.166874C5.489415-6.525529 4.98132-7.023661 4.024907-7.023661C2.161893-7.023661 .557908-5.439601 .557908-3.407223Z'/> <path id='tikz-d97cedc2-g0-68' d='M.348692-6.804483V-6.495641H.587796C1.354919-6.495641 1.374844-6.386052 1.374844-6.027397V-.777086C1.374844-.418431 1.354919-.308842 .587796-.308842H.348692V0H3.995019C5.668742 0 7.043587-1.474471 7.043587-3.347447C7.043587-5.240349 5.69863-6.804483 3.995019-6.804483H.348692ZM2.719801-.308842C2.251557-.308842 2.231631-.37858 2.231631-.707347V-6.097136C2.231631-6.425903 2.251557-6.495641 2.719801-6.495641H3.716065C4.333748-6.495641 5.021171-6.276463 5.529265-5.569116C5.957659-4.98132 6.047323-4.124533 6.047323-3.347447C6.047323-2.241594 5.858032-1.643836 5.499377-1.155666C5.300125-.886675 4.732254-.308842 3.726027-.308842H2.719801Z'/> </defs> <g id='tikz-d97cedc2-page1'> <g stroke-miterlimit='10' transform='matrix(.996264 0 0 -.996264 -58.35116 -58.35116)' fill='currentColor' stroke='currentColor' stroke-width='0.4'> <path d='M12.50002 0C12.50002 6.90366 6.90366 12.50002 0 12.50002S-12.50002 6.90366-12.50002 0S-6.90366-12.50002 0-12.50002S12.50002-6.90366 12.50002 0ZM0 0' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 54.819977 -61.986637)' stroke='none' fill='currentColor'> <use x='-58.35116' y='-58.35116' xlink:href='#tikz-d97cedc2-g0-65'/> </g> <path d='M97.85828 0C97.85828 6.90366 92.26192 12.50002 85.35826 12.50002S72.85825 6.90366 72.85825 0S78.4546-12.50002 85.35826-12.50002S97.85828-6.90366 97.85828 0ZM85.35826 0' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 140.386567 -61.986637)' stroke='none' fill='currentColor'> <use x='-58.35116' y='-58.35116' xlink:href='#tikz-d97cedc2-g0-66'/> </g> <path d='M183.21654 0C183.21654 6.90366 177.62018 12.50002 170.71652 12.50002C163.81287 12.50002 158.2165 6.90366 158.2165 0S163.81287-12.50002 170.71652-12.50002C177.62018-12.50002 183.21654-6.90366 183.21654 0ZM170.71652 0' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 225.675387 -61.986637)' stroke='none' fill='currentColor'> <use x='-58.35116' y='-58.35116' xlink:href='#tikz-d97cedc2-g0-67'/> </g> <path d='M268.5748 0C268.5748 6.90366 262.97844 12.50002 256.07478 12.50002C249.17113 12.50002 243.57477 6.90366 243.57477 0S249.17113-12.50002 256.07478-12.50002C262.97844-12.50002 268.5748-6.90366 268.5748 0ZM256.07478 0' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 310.825317 -61.986637)' stroke='none' fill='currentColor'> <use x='-58.35116' y='-58.35116' xlink:href='#tikz-d97cedc2-g0-68'/> </g> </g> </g> </svg></figure>


#### Star Graphs

While a disconnected graph may seem useless by itself, when nested within a
larger connected graph they allow us to represent arbitrarily complex topologies
of graphs (we should prove this true!). To accomplish this, we say that
connectedness distributes:

```graph
{A, [B,C]} = [{A, B}, {A, C}]
```

For example a "star" graph with four edge nodes and a single center node can be
represented like this:

```graph
G = { S, [A, B, C, D] }
  = [{S, A}, {S, B}, {S, C}, {S, D}]
```


<figure class="tikz"><svg role="img" aria-label="A star graph, with S in the center connected to A, B, C and D" version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='19.7376em' height='19.7376em' viewBox='-72 -72 197.376329 197.376329'> <defs> <path id='tikz-1d3cefcd-g0-65' d='M3.965131-6.933998C3.915318-7.063512 3.895392-7.13325 3.73599-7.13325S3.5467-7.073474 3.496887-6.933998L1.43462-.976339C1.255293-.468244 .856787-.318804 .318804-.308842V0C.547945-.009963 .976339-.029888 1.334994-.029888C1.643836-.029888 2.161893-.009963 2.480697 0V-.308842C1.982565-.308842 1.733499-.557908 1.733499-.816936C1.733499-.846824 1.743462-.946451 1.753425-.966376L2.211706-2.271482H4.672478L5.200498-.747198C5.210461-.707347 5.230386-.647572 5.230386-.607721C5.230386-.308842 4.672478-.308842 4.403487-.308842V0C4.762142-.029888 5.459527-.029888 5.838107-.029888C6.266501-.029888 6.724782-.019925 7.143213 0V-.308842H6.963885C6.366127-.308842 6.22665-.37858 6.117061-.707347L3.965131-6.933998ZM3.437111-5.818182L4.562889-2.580324H2.321295L3.437111-5.818182Z'/> <path id='tikz-1d3cefcd-g0-66' d='M2.211706-3.646326V-6.097136C2.211706-6.425903 2.231631-6.495641 2.699875-6.495641H3.935243C4.901619-6.495641 5.250311-5.648817 5.250311-5.120797C5.250311-4.483188 4.762142-3.646326 3.656289-3.646326H2.211706ZM4.562889-3.556663C5.529265-3.745953 6.216687-4.383562 6.216687-5.120797C6.216687-5.987547 5.300125-6.804483 4.004981-6.804483H.358655V-6.495641H.597758C1.364882-6.495641 1.384807-6.386052 1.384807-6.027397V-.777086C1.384807-.418431 1.364882-.308842 .597758-.308842H.358655V0H4.26401C5.589041 0 6.485679-.886675 6.485679-1.823163C6.485679-2.689913 5.668742-3.437111 4.562889-3.556663ZM3.945205-.308842H2.699875C2.231631-.308842 2.211706-.37858 2.211706-.707347V-3.427148H4.084682C5.070984-3.427148 5.489415-2.500623 5.489415-1.833126C5.489415-1.125778 4.971357-.308842 3.945205-.308842Z'/> <path id='tikz-1d3cefcd-g0-67' d='M.557908-3.407223C.557908-1.344956 2.171856 .219178 4.024907 .219178C5.648817 .219178 6.625156-1.165629 6.625156-2.321295C6.625156-2.420922 6.625156-2.49066 6.495641-2.49066C6.386052-2.49066 6.386052-2.430884 6.37609-2.331258C6.296389-.9066 5.230386-.089664 4.144458-.089664C3.536737-.089664 1.58406-.428394 1.58406-3.39726C1.58406-6.37609 3.526775-6.714819 4.134496-6.714819C5.220423-6.714819 6.107098-5.808219 6.306351-4.353674C6.326276-4.214197 6.326276-4.184309 6.465753-4.184309C6.625156-4.184309 6.625156-4.214197 6.625156-4.423412V-6.784558C6.625156-6.953923 6.625156-7.023661 6.515567-7.023661C6.475716-7.023661 6.435866-7.023661 6.356164-6.90411L5.858032-6.166874C5.489415-6.525529 4.98132-7.023661 4.024907-7.023661C2.161893-7.023661 .557908-5.439601 .557908-3.407223Z'/> <path id='tikz-1d3cefcd-g0-68' d='M.348692-6.804483V-6.495641H.587796C1.354919-6.495641 1.374844-6.386052 1.374844-6.027397V-.777086C1.374844-.418431 1.354919-.308842 .587796-.308842H.348692V0H3.995019C5.668742 0 7.043587-1.474471 7.043587-3.347447C7.043587-5.240349 5.69863-6.804483 3.995019-6.804483H.348692ZM2.719801-.308842C2.251557-.308842 2.231631-.37858 2.231631-.707347V-6.097136C2.231631-6.425903 2.251557-6.495641 2.719801-6.495641H3.716065C4.333748-6.495641 5.021171-6.276463 5.529265-5.569116C5.957659-4.98132 6.047323-4.124533 6.047323-3.347447C6.047323-2.241594 5.858032-1.643836 5.499377-1.155666C5.300125-.886675 4.732254-.308842 3.726027-.308842H2.719801Z'/> <path id='tikz-1d3cefcd-g0-83' d='M3.476961-3.865504L2.201743-4.174346C1.58406-4.323786 1.195517-4.861768 1.195517-5.439601C1.195517-6.136986 1.733499-6.744707 2.510585-6.744707C4.174346-6.744707 4.393524-5.110834 4.4533-4.662516C4.463263-4.60274 4.463263-4.542964 4.572852-4.542964C4.702366-4.542964 4.702366-4.592777 4.702366-4.782067V-6.784558C4.702366-6.953923 4.702366-7.023661 4.592777-7.023661C4.523039-7.023661 4.513076-7.013699 4.443337-6.894147L4.094645-6.326276C3.795766-6.615193 3.387298-7.023661 2.500623-7.023661C1.39477-7.023661 .557908-6.146949 .557908-5.090909C.557908-4.26401 1.085928-3.536737 1.863014-3.267746C1.972603-3.227895 2.480697-3.108344 3.178082-2.938979C3.447073-2.86924 3.745953-2.799502 4.024907-2.430884C4.234122-2.171856 4.333748-1.843088 4.333748-1.514321C4.333748-.806974 3.835616-.089664 2.998755-.089664C2.709838-.089664 1.952677-.139477 1.424658-.627646C.846824-1.165629 .816936-1.803238 .806974-2.161893C.797011-2.261519 .71731-2.261519 .687422-2.261519C.557908-2.261519 .557908-2.191781 .557908-2.012453V-.019925C.557908 .14944 .557908 .219178 .667497 .219178C.737235 .219178 .747198 .199253 .816936 .089664C.816936 .079701 .846824 .049813 1.175592-.478207C1.484433-.139477 2.122042 .219178 3.008717 .219178C4.174346 .219178 4.971357-.757161 4.971357-1.853051C4.971357-2.849315 4.313823-3.666252 3.476961-3.865504Z'/> </defs> <g id='tikz-1d3cefcd-page1'> <g stroke-miterlimit='10' transform='matrix(.996264 0 0 -.996264 26.688173 26.688173)' fill='currentColor' stroke='currentColor' stroke-width='0.4'> <path d='M12.50002 85.35823C12.50002 92.26189 6.90366 97.85825 0 97.85825S-12.50002 92.26189-12.50002 85.35823S-6.90366 72.85822 0 72.85822S12.50002 78.45457 12.50002 85.35823ZM0 85.35823' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 -30.538254 108.729824)' stroke='none' fill='currentColor'> <use x='26.688173' y='26.688173' xlink:href='#tikz-1d3cefcd-g0-65'/> </g> <path d='M-72.85822 0C-72.85822 6.90366-78.45457 12.50002-85.35823 12.50002S-97.85825 6.90366-97.85825 0S-92.26189-12.50002-85.35823-12.50002S-72.85822-6.90366-72.85822 0ZM-85.35823 0' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 -115.965924 23.371594)' stroke='none' fill='currentColor'> <use x='26.688173' y='26.688173' xlink:href='#tikz-1d3cefcd-g0-68'/> </g> <path d='M12.50002 0C12.50002 6.90366 6.90366 12.50002 0 12.50002S-12.50002 6.90366-12.50002 0S-6.90366-12.50002 0-12.50002S12.50002-6.90366 12.50002 0ZM0 0' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 -29.566044 23.371594)' stroke='none' fill='currentColor'> <use x='26.688173' y='26.688173' xlink:href='#tikz-1d3cefcd-g0-83'/> </g> <path d='M97.85825 0C97.85825 6.90366 92.26189 12.50002 85.35823 12.50002S72.85822 6.90366 72.85822 0S78.45457-12.50002 85.35823-12.50002S97.85825-6.90366 97.85825 0ZM85.35823 0' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 55.028306 23.371594)' stroke='none' fill='currentColor'> <use x='26.688173' y='26.688173' xlink:href='#tikz-1d3cefcd-g0-66'/> </g> <path d='M12.50002-85.35823C12.50002-78.45457 6.90366-72.85822 0-72.85822S-12.50002-78.45457-12.50002-85.35823S-6.90366-97.85825 0-97.85825S12.50002-92.26189 12.50002-85.35823ZM0-85.35823' fill='none'/> <g transform='matrix(1.00375 0 0 -1.00375 -30.399364 -61.986636)' stroke='none' fill='currentColor'> <use x='26.688173' y='26.688173' xlink:href='#tikz-1d3cefcd-g0-67'/> </g> <path d='M0 12.70154V72.66707' fill='none'/> <path d='M12.70154 0H72.66707' fill='none'/> <path d='M0-12.70154V-72.66707' fill='none'/> <path d='M-12.70154 0H-72.66707' fill='none'/> </g> </g> </svg></figure>


#### Example Reduction

Here we show that starting with a graph description `G`, we end up with an
equivalent graph description `G'` through a series of reductions.

We define `G` to be a graph of a disconnected `[A,B]`, connected to `C`, all
disconnected from `D`, finally connected to `E`. We can interpret this more
naturally by thinking of the fully connected graph `{A,B,C,D,E}`, then removing
connections to maintain the property that `[A,B]` and `[D, {A,B,C}]` are
disconnected.

```graph
G  = {[{[A,B],C},D],E}
   -distributeC>
     {[[{A,C},{B,C}],D],E}
   -flatten>
     {[{A,C},{B,C},D],E}
   -distributeE>
G' = [{A,C,E},{B,C,E},{D,E}]
```

As you can see in the final, _normal_ form, `A` and `B` are never connected, and
neither is `D` connected with any node other than `E`, which is precisely what
we asked for.

---

This was originally a thought experiment in [Achilles' Tent Note #12](/research/2019-12-02-achilles-12), but I think it's a fun
way to express arbitrary graphs. I'm not sure how novel (or complete) it is
however, but I thought I'd unbury it a bit in case someone else finds it
interesting. I've also trimmed the contents of the original post a bit to remove
the stuff related to MPC, which is completely outside the scope of this post,
and expanded on a few things.

Since I posted this I've implemented the basic idea in
[nixpulvis/grapl](https://github.com/nixpulvis/grapl). Some people have also
given me feedback about the difficulty describing ad-hoc edges and arbitrary
cyclic structures. I'm considering some extensions to make this easier, but
nothing final yet. I'll try to update this post to point to the implementation
if/when I finish it.
