diff options
Diffstat (limited to 'assets/levels/eulerian')
-rw-r--r-- | assets/levels/eulerian/add-edges-cycle.xml | 25 | ||||
-rw-r--r-- | assets/levels/eulerian/add-edges-path.xml | 28 | ||||
-rw-r--r-- | assets/levels/eulerian/cycles.xml | 38 | ||||
-rw-r--r-- | assets/levels/eulerian/double-add-one.xml | 41 | ||||
-rw-r--r-- | assets/levels/eulerian/paths.xml | 37 |
5 files changed, 169 insertions, 0 deletions
diff --git a/assets/levels/eulerian/add-edges-cycle.xml b/assets/levels/eulerian/add-edges-cycle.xml new file mode 100644 index 0000000..8a8c120 --- /dev/null +++ b/assets/levels/eulerian/add-edges-cycle.xml @@ -0,0 +1,25 @@ +<level title="Maximal Eulerian Cycle" description="Add as many edges as possible while still having an Eulerian cycle" objective="+1 point per edge, +3 points per edge in cycle"/> +<global-vertex-protections protect="acd"/> +<global-edge-protections protect="c"/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="200" y="450" id="l"/> + <vertex x="300" y="400" id="top-l"/> + <vertex x="400" y="350" id="top-m"/> + <vertex x="500" y="400" id="top-r"/> + <vertex x="300" y="500" id="bot-l"/> + <vertex x="400" y="550" id="bot-m"/> + <vertex x="500" y="500" id="bot-r"/> + <vertex x="600" y="450" id="r"/> +</graph> +<rules/> +<cycle points="0"> + <edge color="any" op="+" val="3"/> +</cycle> +<values> + <op id="points" op="-" val1="E" val2="20"/> + <var id="objective" val="44"/> +</values> + diff --git a/assets/levels/eulerian/add-edges-path.xml b/assets/levels/eulerian/add-edges-path.xml new file mode 100644 index 0000000..937e3b6 --- /dev/null +++ b/assets/levels/eulerian/add-edges-path.xml @@ -0,0 +1,28 @@ +<level title="Maximal Eulerian Path" description="Add as many edges as possible while still having an Eulerian path.;No two adjacent vertices can have the same color." objective="+1 point per edge, +3 points per edge in path"/> +<global-vertex-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#00FF00" name="green"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="200" y="450" id="l" color="red"/> + <vertex x="300" y="400" id="top-l" color="red"/> + <vertex x="400" y="350" id="top-m" color="green"/> + <vertex x="500" y="400" id="top-r" color="blue"/> + <vertex x="300" y="500" id="bot-l" color="red"/> + <vertex x="400" y="550" id="bot-m" color="green"/> + <vertex x="500" y="500" id="bot-r" color="blue"/> + <vertex x="600" y="450" id="r" color="blue"/> +</graph> +<rules> + <edge-rule v1="same" v2="same"/> +</rules> +<path points="0"> + <edge color="any" op="+" val="3"/> +</path> +<values> + <op id="points" op="-" val1="E" val2="20"/> + <var id="objective" val="56"/> +</values> + diff --git a/assets/levels/eulerian/cycles.xml b/assets/levels/eulerian/cycles.xml new file mode 100644 index 0000000..1b36652 --- /dev/null +++ b/assets/levels/eulerian/cycles.xml @@ -0,0 +1,38 @@ +<level title="Eulerian Cycles" description="Every graph where all the vertices have an even degree has an Eulerian cycle.;An Eulerian cycle is a cycle through the graph that goes through each edge exactly once.;Right-click vertices in the order of an Eulerian cycle.;Press E to cancel your cycle." objective="Find an Eulerian cycle."/> +<global-vertex-protections protect="acd"/> +<global-edge-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="300" y="400" id="top-l"/> + <vertex x="400" y="350" id="top-m"/> + <vertex x="500" y="400" id="top-r"/> + <vertex x="300" y="500" id="bot-l"/> + <vertex x="400" y="550" id="bot-m"/> + <vertex x="500" y="500" id="bot-r"/> + + <edge v1="top-l" v2="top-r"/> + <edge v1="top-l" v2="bot-l"/> + <edge v1="top-l" v2="bot-m"/> + <edge v1="top-l" v2="bot-r"/> + + <edge v1="top-m" v2="bot-l"/> + <edge v1="top-m" v2="bot-r"/> + + <edge v1="top-r" v2="bot-l"/> + <edge v1="top-r" v2="bot-m"/> + <edge v1="top-r" v2="bot-r"/> + + + <edge v1="bot-l" v2="bot-r"/> +</graph> +<rules/> +<cycle points="0"> + <edge color="any" op="+" val="1"/> +</cycle> +<values> + <var id="points" val="0"/> + <var id="objective" val="E"/> +</values> + diff --git a/assets/levels/eulerian/double-add-one.xml b/assets/levels/eulerian/double-add-one.xml new file mode 100644 index 0000000..b25b71b --- /dev/null +++ b/assets/levels/eulerian/double-add-one.xml @@ -0,0 +1,41 @@ +<level title="Best Path" description="Find a path through the graph (it does not have to be Eulerian).;Every time it passes through a red edge, your score will increase by 1.;Every time it passes through a blue edge, your score will double." objective="Earn as many points as possible."/> +<global-vertex-protections protect="acd"/> +<global-edge-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> + <color color="#0000FF" name="blue"/> +</colors> +<graph> + <vertex x="200" y="450" id="l"/> + <vertex x="300" y="400" id="top-l"/> + <vertex x="400" y="350" id="top-m"/> + <vertex x="500" y="400" id="top-r"/> + <vertex x="300" y="500" id="bot-l"/> + <vertex x="400" y="550" id="bot-m"/> + <vertex x="500" y="500" id="bot-r"/> + <vertex x="600" y="450" id="r"/> + + <edge v1="l" v2="top-l" color="red"/> + <edge v1="top-l" v2="top-m" color="red"/> + <edge v1="top-m" v2="top-r" color="red"/> + <edge v1="top-r" v2="r" color="red"/> + <edge v1="r" v2="bot-r" color="red"/> + <edge v1="bot-r" v2="bot-m" color="red"/> + <edge v1="bot-m" v2="bot-l" color="red"/> + <edge v1="bot-l" v2="l" color="red"/> + + + <edge v1="l" v2="r" color="blue"/> + <edge v1="top-l" v2="bot-l" color="blue"/> + <edge v1="top-m" v2="bot-m" color="blue"/> + <edge v1="top-r" v2="bot-r" color="blue"/> +</graph> +<path points="0"> + <edge color="red" op="+" val="1"/> + <edge color="blue" op="*" val="2"/> +</path> +<values> + <var id="points" val="0"/> + <var id="objective" val="46"/> +</values> + diff --git a/assets/levels/eulerian/paths.xml b/assets/levels/eulerian/paths.xml new file mode 100644 index 0000000..c3fa8b7 --- /dev/null +++ b/assets/levels/eulerian/paths.xml @@ -0,0 +1,37 @@ +<level title="Eulerian Paths" description="Every graph where all the vertices except for 2 have an even;degree has an Eulerian path.;An Eulerian path is a path through the graph that goes through each edge exactly once.;Paths do not have to start and end in the same place" objective="Find an Eulerian path in this graph."/> +<global-vertex-protections protect="acd"/> +<global-edge-protections protect="acd"/> +<colors> + <color color="#FF0000" name="red"/> +</colors> +<graph> + <vertex x="300" y="400" id="top-l"/> + <vertex x="400" y="350" id="top-m"/> + <vertex x="500" y="400" id="top-r"/> + <vertex x="300" y="500" id="bot-l"/> + <vertex x="400" y="550" id="bot-m"/> + <vertex x="500" y="500" id="bot-r"/> + + <edge v1="top-l" v2="bot-l"/> + <edge v1="top-l" v2="bot-m"/> + <edge v1="top-l" v2="bot-r"/> + + <edge v1="top-m" v2="bot-l"/> + <edge v1="top-m" v2="bot-r"/> + + <edge v1="top-r" v2="bot-l"/> + <edge v1="top-r" v2="bot-m"/> + <edge v1="top-r" v2="bot-r"/> + + + <edge v1="bot-l" v2="bot-r"/> +</graph> +<rules/> +<path points="0"> + <edge color="any" op="+" val="1"/> +</path> +<values> + <var id="points" val="0"/> + <var id="objective" val="E"/> +</values> + |