Skip to content

Commit 67e41d7

Browse files
committed
doc: updated cycle figures, addresses #27
1 parent 1ea8f3e commit 67e41d7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
69.5 KB
Loading
64.6 KB
Loading

docs/source/tutorial/cycles.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ However, there are many instances where variables might represent multiple value
1212

1313
Let's say for example, that we wanted to solve for the position :math:`x` of a car moving at constant velocity :math:`v`. The first step would be to set the starting position :math:`x_0` and add it to the hypergraph. We can then add another node for the position after :math:`\Delta{}t` seconds had gone by and call it :math:`x_1`. The relationship between :math:`x_1` and :math:`x_0` is :math:`x_1 = x_0 + v\Delta{}t`, which we can easily make into a hyperedge. We could repeat this process for the position after :math:`2\Delta{}t` seconds had gone by, noting that :math:`x_2 = x_1 + v\Delta{}t`. This results in a drawn out hypergraph similar to the one shown in :ref:`Figure 1 <chg_simple>`.
1414

15-
.. figure:: https://github.com/user-attachments/assets/d42a03a5-9fd8-4e62-81bd-92a99c94b77e
15+
.. figure:: ../media/figures/unraveled-cycle.png
1616
:alt: Simple CHG
17-
:width: 681px
17+
:width: 500px
1818
:align: center
1919
:name: chg_simple
2020

21-
*A simple hypergraph explicitly mapping out the relationships between variables*
21+
*A simple hypergraph explicitly mapping out the relationships between variables.*
2222

2323
Such a modeling process is not only tedious, it lacks expressability. What we really want to model is the relationship :math:`x_{i+1} = x_i + v\Delta{}t`, rather than every incremental relation. The trick for adding the variables :math:`x_i` and :math:`x_{i+1}` to the hypergraph is to use cycles.
2424

2525
Cycles enable arbitrary indexing of a variable, allowing us to express these recursive type expressions without have to explicitly map out every single instance of a variable, as shown in :ref:`Figure 2 <chg_nonsimple>`.
2626

27-
.. figure:: https://github.com/user-attachments/assets/cb8387cc-e005-4ed9-9247-2599f76f323b
27+
.. figure:: ../media/figures/basic-cycle.png
2828
:alt: Non-simple CHG with a cycle
29-
:width: 681px
29+
:width: 600px
3030
:align: center
3131
:name: chg_nonsimple
3232

33-
*A non-simple hypergraph with a cycle*
33+
*A non-simple hypergraph compressing* :ref:`Figure 1<chg_simple>` *with a cycle, where the cycle is terminated by a conditional edge when* :math:`i \geq n`.
3434

3535
If you print the ``summary`` method on the `above constraint hypergraph <https://github.com/jmorris335/ConstraintHg/blob/main/demos/demo_linear_motion.py>`_, you'll get the following output:
3636

0 commit comments

Comments
 (0)