WolframAlpha.com
WolframCloud.com
All Sites & Public Resources...
Products & Services
Wolfram|One
Mathematica
Wolfram|Alpha Notebook Edition
Programming Lab
Finance Platform
SystemModeler
Wolfram Player
Wolfram Engine
WolframScript
Enterprise Private Cloud
Enterprise Mathematica
Wolfram|Alpha Appliance
Enterprise Solutions
Corporate Consulting
Technical Consulting
Wolfram|Alpha Business Solutions
Resource System
Data Repository
Neural Net Repository
Function Repository
Wolfram|Alpha
Wolfram|Alpha Pro
Problem Generator
API
Data Drop
Products for Education
Mobile Apps
Wolfram Player
Wolfram Cloud App
Wolfram|Alpha for Mobile
Wolfram|Alpha-Powered Apps
Services
Paid Project Support
Wolfram U
Summer Programs
All Products & Services »
Technologies
Wolfram Language
Revolutionary knowledge-based programming language.
Wolfram Cloud
Central infrastructure for Wolfram's cloud products & services.
Wolfram Science
Technology-enabling science of the computational universe.
Wolfram Notebooks
The preeminent environment for any technical workflows.
Wolfram Engine
Software engine implementing the Wolfram Language.
Wolfram Natural Language Understanding System
Knowledge-based broadly deployed natural language.
Wolfram Data Framework
Semantic framework for real-world data.
Wolfram Universal Deployment System
Instant deployment across cloud, desktop, mobile, and more.
Wolfram Knowledgebase
Curated computable knowledge powering Wolfram|Alpha.
All Technologies »
Solutions
Engineering, R&D
Aerospace & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Mechanical Engineering
Operations Research
More...
Finance, Statistics & Business Analysis
Actuarial Sciences
Bioinformatics
Data Science
Econometrics
Financial Risk Management
Statistics
More...
Education
All Solutions for Education
Trends
Machine Learning
Multiparadigm Data Science
Internet of Things
High-Performance Computing
Hackathons
Software & Web
Software Development
Authoring & Publishing
Interface Development
Web Development
Sciences
Astronomy
Biology
Chemistry
More...
All Solutions »
Learning & Support
Learning
Wolfram Language Documentation
Fast Introduction for Programmers
Wolfram U
Videos & Screencasts
Wolfram Language Introductory Book
Webinars & Training
Summer Programs
Books
Need Help?
Support FAQ
Wolfram Community
Contact Support
Premium Support
Paid Project Support
Technical Consulting
All Learning & Support »
Company
About
Company Background
Wolfram Blog
Events
Contact Us
Work with Us
Careers at Wolfram
Internships
Other Wolfram Language Jobs
Initiatives
Wolfram Foundation
MathWorld
Computer-Based Math
A New Kind of Science
Wolfram Technology for Hackathons
Student Ambassador Program
Wolfram for Startups
Demonstrations Project
Wolfram Innovator Awards
Wolfram + Raspberry Pi
Summer Programs
More...
All Company »
Search
WOLFRAM COMMUNITY
Connect with users of Wolfram technologies to learn, solve problems and share ideas
Join
Sign In
Dashboard
Groups
People
Search
Message Boards
Answer
(
Unmark
)
Mark as an Answer
GROUPS:
Staff Picks
Material Sciences
Physics
Geometry
Graphics and Visualization
Wolfram Language
Wolfram Summer School
17
Radhika Prasad
[WSS20] Cellular Automata (CA) on 3D Lattices
Radhika Prasad, Indian Institute of Technology (IIT) Kanpur
Posted
8 months ago
3320 Views
|
4 Replies
|
21 Total Likes
Follow this post
|
The aim of the project is to work with lattices (in 3D) and to be able to perform computational tasks on the lattice elements. This requires proper indexing of the lattice points themselves, as well as the unit cells defined on them (by the basis vectors). A nice way to visualise the computation (and to check if the indexing is proper) is to be able to run Cellular Automaton on the lattices and plot the output state by highlighting the unit cells or the lattice points which have the desired state (a state of “1” as a result of the Cellular Automaton). The indexing of lattice points and unit cells would enable us to create a 3D analogue of the 2D ArrayPlot function. Finally, the neighbourhoods of the lattices are classified which is crucial for defining Cellular Automata rules. The Cellular Automata would yield interesting patterns within the lattice and provide models for crystal growth.
Introduction to Lattices
A lattice is an infinite array of translationally invariant points in space. Lattices and unit cells are important concepts in the fields of Crystallography and Solid State Physics. They are used for classification and identification of crystals and their underlying structure. The enumeration of all possible lattices (based on the symmetries they possess) is given by
B
r
a
v
a
i
s
l
a
t
t
i
c
e
s
. In 2D, we have 5 possible Bravais lattices, whereas in 3D, we have 14 possible Bravais lattices. This means, that any possible lattice in 3D would actually be one of the 14 possible Bravais lattices.
Generation of Lattices
To begin working with lattices, we first need to generate them. Let us see how to generate lattice points in 3D. A lattice in 3D space would require a set of 3 basis vectors (
a
1
,
a
2
,
a
3
) which govern the repetition and translation periodicity of the lattice points. The translation operator (
T
) given by:
T
n
1
a
1
+
n
2
a
2
+
n
3
a
3
generates all the lattices points (
n
1
,
n
2
,
n
3
are integers). Code for generating the lattice points from the basis vectors is given below:
(
*
P
l
o
t
l
a
t
t
i
c
e
p
o
i
n
t
s
b
a
s
e
d
o
n
b
a
s
i
s
v
e
c
t
o
r
s
(
b
a
s
i
s
)
a
n
d
d
i
m
e
n
s
i
o
n
s
(
d
i
m
)
*
)
l
a
t
t
i
c
e
P
o
i
n
t
s
P
l
o
t
[
b
a
s
i
s
_
,
d
i
m
_
]
:
=
M
o
d
u
l
e
[
{
l
a
t
t
i
c
e
P
t
s
}
,
l
a
t
t
i
c
e
P
t
s
=
F
l
a
t
t
e
n
[
T
a
b
l
e
[
T
o
t
a
l
[
b
a
s
i
s
*
{
d
1
,
d
2
,
d
3
}
]
,
{
d
1
,
1
,
d
i
m
[
[
1
]
]
}
,
{
d
2
,
1
,
d
i
m
[
[
2
]
]
}
,
{
d
3
,
1
,
d
i
m
[
[
3
]
]
}
]
,
2
]
;
G
r
a
p
h
i
c
s
3
D
[
{
P
o
i
n
t
S
i
z
e
[
L
a
r
g
e
]
,
P
o
i
n
t
[
l
a
t
t
i
c
e
P
t
s
]
}
]
]
l
a
t
t
i
c
e
P
o
i
n
t
s
P
l
o
t
[
{
{
1
,
0
,
0
}
,
{
0
,
1
,
0
}
,
{
0
,
0
,
1
}
}
,
{
4
,
4
,
4
}
]
O
u
t
[
]
=
Now, the basis vectors (
a
1
,
a
2
,
a
3
) would define a conventional unit cell, which will be a parallelepiped (a cube is a special case of a parallelepiped). We can generate a lattice by “stacking” these parallelepiped unit cells.
b
a
s
i
s
V
e
c
t
o
r
s
=
{
{
1
,
0
,
0
}
,
{
0
,
1
,
0
}
,
{
0
,
0
,
1
}
}
;
u
n
i
t
C
e
l
l
E
d
g
e
=
P
a
r
a
l
l
e
l
e
p
i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
o
v
e
e
x
a
m
p
l
e
s
c
o
r
r
e
s
p
o
n
d
t
o
P
r
i
m
i
t
i
v
e
C
u
b
i
c
l
a
t
t
i
c
e
.
B
e
l
o
w
a
r
e
s
o
m
e
i
m
a
g
e
s
c
o
r
r
e
s
p
o
n
d
i
n
g
t
o
a
g
e
n
e
r
a
l
l
a
t
t
i
c
e
(
w
i
t
h
p
a
r
a
l
l
e
l
e
p
i
p
e
d
u
n
i
t
c
e
l
l
s
)
.
A fun way to visualise is by placing spheres at lattice points. In fact, this is used in crystallography for studying crystal structures where atoms are modelled as spheres and they are sitting at lattice points.
G
r
a
p
h
i
c
s
3
D
[
T
a
b
l
e
[
S
p
h
e
r
e
[
{
x
,
y
,
z
}
,
1
/
2
]
,
{
x
,
5
}
,
{
y
,
5
}
,
{
z
,
5
}
]
]
I
n
[
]
:
=
O
u
t
[
]
=
Neighbourhood in Lattice Structures
I
n
o
r
d
e
r
t
o
r
u
n
C
e
l
l
u
l
a
r
A
u
t
o
m
a
t
a
(
C
A
)
o
n
l
a
t
t
i
c
e
s
,
w
e
n
e
e
d
t
o
c
l
e
a
r
l
y
d
e
f
i
n
e
t
h
e
“
n
e
i
g
h
b
o
u
r
h
o
o
d
s
.
”
T
h
i
s
i
s
t
o
b
e
d
o
n
e
s
e
p
a
r
a
t
e
l
y
f
o
r
t
w
o
c
a
s
e
s
:
(
i
)
n
e
i
g
h
b
o
u
r
h
o
o
d
o
f
a
c
o
n
v
e
n
t
i
o
n
a
l
p
a
r
a
l
l
e
l
e
p
i
p
e
d
,
(
i
i
)
n
e
i
g
h
b
o
u
r
h
o
o
d
o
f
l
a
t
t
i
c
e
p
o
i
n
t
s
t
h
e
m
s
e
l
v
e
s
.
I
n
o
r
d
e
r
t
o
u
n
d
e
r
s
t
a
n
d
t
h
i
s
c
o
n
c
e
p
t
p
r
o
p
e
r
l
y
,
l
e
t
u
s
l
o
o
k
a
t
t
h
e
2
D
c
a
s
e
.
T
h
e
b
l
u
e
l
a
t
t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
M
o
o
r
e
(
w
h
i
c
h
i
n
c
l
u
d
e
s
t
h
e
“
d
i
a
g
o
n
a
l
”
c
e
l
l
s
)
.
N
o
w
,
w
e
c
a
n
t
u
r
n
o
u
r
a
t
t
e
n
t
i
o
n
t
o
r
u
n
n
i
n
g
C
A
o
n
3
D
l
a
t
t
i
c
e
s
.
T
h
e
r
e
a
r
e
t
w
o
p
o
s
s
i
b
l
e
c
a
s
e
s
,
o
n
e
w
o
u
l
d
b
e
t
o
r
u
n
C
A
o
n
t
h
e
c
o
n
v
e
n
t
i
o
n
a
l
p
a
r
a
l
l
e
l
e
p
i
p
e
d
u
n
i
t
c
e
l
l
s
,
t
h
e
o
t
h
e
r
o
p
t
i
o
n
i
s
t
o
r
u
n
t
h
e
m
o
n
t
h
e
l
a
t
t
i
c
e
p
o
i
n
t
s
.
F
i
r
s
t
,
w
e
w
i
l
l
l
o
o
k
a
t
u
n
i
t
c
e
l
l
c
a
s
e
.
Cellular Automata on Conventional Parallelepiped Unit Cells
The built-in
C
e
l
l
u
l
a
r
A
u
t
o
m
a
t
o
n
function has capabilities to work in 3D, but with only cube cells. However, topologically speaking, a cube and a general parallelepiped are same. This is because both have 6 faces, and hence 6 “face-touching” neighbours, leading to both having identical “neighbourhood” structure. Thus, it is easy to generalise the special case of a Primitive Cubic lattice to any general lattice for the case of CA on unit cells. Below is the code for plotting the outcome of a particular CA rule (GrowthCases->1) on the Primitive Cubic lattice and a general lattice.
p
o
s
O
n
e
=
P
o
s
i
t
i
o
n
[
C
e
l
l
u
l
a
r
A
u
t
o
m
a
t
o
n
[
<
|
"
G
r
o
w
t
h
C
a
s
e
s
"
{
1
}
,
"
D
i
m
e
n
s
i
o
n
"
3
,
"
N
e
i
g
h
b
o
r
h
o
o
d
"
7
|
>
,
{
{
{
{
1
}
}
}
,
0
}
,
{
{
{
2
}
}
}
]
,
1
]
;
d
i
m
e
n
s
i
o
n
=
M
a
x
[
F
l
a
t
t
e
n
[
p
o
s
O
n
e
]
]
;
G
r
a
p
h
i
c
s
3
D
[
{
T
a
b
l
e
[
T
r
a
n
s
l
a
t
e
[
u
n
i
t
C
e
l
l
E
d
g
e
,
{
p
o
s
O
n
e
[
[
i
2
]
]
[
[
1
]
]
*
b
a
s
i
s
V
e
c
t
o
r
s
[
[
1
]
]
+
p
o
s
O
n
e
[
[
i
2
]
]
[
[
2
]
]
*
b
a
s
i
s
V
e
c
t
o
r
s
[
[
2
]
]
+
p
o
s
O
n
e
[
[
i
2
]
]
[
[
3
]
]
*
b
a
s
i
s
V
e
c
t
o
r
s
[
[
3
]
]
}
]
,
{
i
2
,
L
e
n
g
t
h
[
p
o
s
O
n
e
]
}
]
,
F
a
c
e
F
o
r
m
[
N
o
n
e
]
,
T
a
b
l
e
[
T
r
a
n
s
l
a
t
e
[
u
n
i
t
C
e
l
l
E
d
g
e
,
{
i
*
b
a
s
i
s
V
e
c
t
o
r
s
[
[
1
]
]
+
j
*
b
a
s
i
s
V
e
c
t
o
r
s
[
[
2
]
]
+
k
*
b
a
s
i
s
V
e
c
t
o
r
s
[
[
3
]
]
}
]
,
{
i
,
1
,
d
i
m
e
n
s
i
o
n
}
,
{
j
,
1
,
d
i
m
e
n
s
i
o
n
}
,
{
k
,
1
,
d
i
m
e
n
s
i
o
n
}
]
}
,
B
o
x
e
d
F
a
l
s
e
]
(
*
d
e
f
i
n
i
t
i
o
n
o
f
b
a
s
i
s
V
e
c
t
o
r
s
a
n
d
u
n
i
t
C
e
l
l
E
d
g
e
p
r
o
v
i
d
e
d
i
n
a
b
o
v
e
s
e
c
t
i
o
n
s
*
)
Steps of evolution of the CA on the cube unit cells of Primitive Cubic lattice (1st image is the initial condition):
Steps of evolution of the CA on the parallelepiped unit cells of general lattice (1st image is the initial condition):
C
o
m
p
a
r
i
n
g
s
t
e
p
3
(
t
h
e
4
t
h
i
m
a
g
e
i
n
t
h
e
a
b
o
v
e
s
e
r
i
e
s
)
o
f
t
h
e
C
A
f
o
r
P
r
i
m
i
t
i
v
e
C
u
b
i
c
a
n
d
g
e
n
e
r
a
l
l
a
t
t
i
c
e
:
C
l
e
a
r
l
y
,
t
h
e
s
t
r
u
c
t
u
r
e
o
f
g
r
o
w
t
h
i
s
s
i
m
i
l
a
r
.
T
h
e
g
e
n
e
r
a
l
p
a
r
a
l
l
e
l
e
p
i
p
e
d
c
a
s
e
i
s
j
u
s
t
l
i
k
e
a
“
s
t
r
e
t
c
h
e
d
o
u
t
”
v
e
r
s
i
o
n
o
f
t
h
e
c
u
b
i
c
c
a
s
e
.
T
h
u
s
,
t
h
e
c
a
s
e
o
f
C
A
o
n
t
h
e
u
n
i
t
c
e
l
l
s
o
f
3
D
l
a
t
t
i
c
e
s
h
a
s
b
e
e
n
s
o
l
v
e
d
f
u
l
l
y
.
3D Analogue of ArrayPlot for Unit Cells
A part of the task of working with unit cells involved indexing them and their neighbourhood in a proper fashion. The built-in
A
r
r
a
y
P
l
o
t
function takes in a 2D array which specifies the indices of the cells of a 2D square lattice to highlight with a specific colour. I have created a 3D analogue of it which performs the similar task for the case of general 3D lattices. Below is the code (function latticeParallelepipedPlot) which takes in the basis vectors and dimensions for repetition of the unit cells as inputs. The indices for the unit cells to be highlighted is an option, along with some background lattice options (ie how the other “non-highlighted” unit cells should look). The examples following the code show the output which is a collection of conventional parallelepiped unit cells for the given set of basis vectors.
(
*
i
n
c
o
r
p
o
r
a
t
e
o
p
t
i
o
n
s
f
o
r
h
i
g
h
l
i
g
h
t
i
n
g
u
n
i
t
c
e
l
l
s
*
)
O
p
t
i
o
n
s
[
l
a
t
t
i
c
e
P
a
r
a
l
l
e
l
e
p
i
p
e
d
P
l
o
t
]
=
{
p
o
s
C
o
n
s
t
a
n
t
A
r
r
a
y
[
1
,
d
i
m
e
n
s
i
o
n
]
,
b
a
c
k
g
r
o
u
n
d
"
U
n
i
t
C
e
l
l
E
d
g
e
"
}
;
l
a
t
t
i
c
e
P
a
r
a
l
l
e
l
e
p
i
p
e
d
P
l
o
t
[
b
a
s
i
s
_
,
d
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m
[
[
2
]
]
}
,
{
k
,
1
,
d
i
m
[
[
3
]
]
}
]
}
}
,
B
o
x
e
d
F
a
l
s
e
]
]
]
l
a
t
t
i
c
e
P
a
r
a
l
l
e
l
e
p
i
p
e
d
P
l
o
t
[
{
{
1
,
1
,
0
}
/
2
,
{
1
,
0
,
1
}
/
2
,
{
0
,
1
,
1
}
/
2
}
,
{
2
,
2
,
2
}
]
(
*
w
i
t
h
o
u
t
g
i
v
i
n
g
a
n
y
o
p
t
i
o
n
a
l
a
r
g
u
m
e
n
t
s
,
a
l
l
t
h
e
p
a
r
a
l
l
e
l
e
p
i
p
e
d
c
e
l
l
s
a
r
e
d
r
a
w
n
*
)
O
u
t
[
]
=
l
a
t
t
i
c
e
P
a
r
a
l
l
e
l
e
p
i
p
e
d
P
l
o
t
[
{
{
1
,
1
,
0
}
/
2
,
{
1
,
0
,
1
}
/
2
,
{
0
,
1
,
1
}
/
2
}
,
{
2
,
2
,
2
}
,
p
o
s
{
{
{
1
,
0
}
,
{
0
,
1
}
}
,
{
{
0
,
0
}
,
{
1
,
1
}
}
}
,
b
a
c
k
g
r
o
u
n
d
"
P
o
i
n
t
s
A
n
d
C
e
l
l
"
]
(
*
w
i
t
h
t
h
e
o
p
t
i
o
n
a
l
a
r
g
u
m
e
n
t
p
o
s
,
o
n
l
y
t
h
e
c
e
l
l
s
a
t
t
h
e
s
p
e
c
i
f
i
e
d
i
n
d
i
c
e
s
a
r
e
h
i
g
h
l
i
g
h
t
e
d
*
)
O
u
t
[
]
=
Cellular Automata on Lattice Points
Working with lattice points and defining their neighbourhood is a considerably more difficult task. This is because one now needs to work with the Voronoi regions instead of the conventional parallelepiped unit cells.
Voronoi Regions
The Voronoi region around a lattice point is defined as the locus of points in space that are closer to that point than to any of the other lattice points. Simply speaking, this defines the maximum volume around each lattice point which would not overlap or interfere with the space around other lattice points. The Voronoi regions provide a unit cell for the lattice (which is not the conventional parallelepiped) and hence they are space-filling polyhedra. Their shapes could be very complicated. For example, the Face-Centred Cubic lattice has Rhombic Dodecahedron (12 faces) as its Voronoi region. The maximum number of faces that a Voronoi region can have is 14 (for example, the Voronoi cell for the Body-Centred Cubic lattice is Truncated Octahedron which has 14 faces). Thus, the number of neighbours for different lattices will be different. Fortunately for us, there are
only 5 topologically distinct Voronoi types
. This means, each of the 14 Bravais lattices will have a shape of Voronoi cell falling into one of the 5 Voronoi types. They are listed below.
List of the 5 Voronoi Types with an example Bravais Lattice:
V
1
:
T
r
u
n
c
a
t
e
d
O
c
t
a
h
e
d
r
o
n
(
B
o
d
y
-
C
e
n
t
r
e
d
C
u
b
i
c
)
◼
V
2
:
H
e
x
a
r
h
o
m
b
i
c
D
o
d
e
c
a
h
e
d
r
o
n
(
B
o
d
y
-
C
e
n
t
r
e
d
T
e
t
r
a
g
o
n
a
l
)
◼
V
3
:
R
h
o
m
b
o
h
e
d
r
a
l
D
o
d
e
c
a
h
e
d
r
o
n
(
F
a
c
e
-
C
e
n
t
r
e
d
C
u
b
i
c
)
◼
V
4
:
H
e
x
a
g
o
n
a
l
P
r
i
s
m
(
P
r
i
m
i
t
i
v
e
H
e
x
a
g
o
n
a
l
)
◼
V
5
:
C
u
b
o
i
d
(
P
r
i
m
i
t
i
v
e
C
u
b
i
c
)
◼
Having once generated each of the above mentioned 5 Voronoi types, we can be confident about working with any lattice.
Neighbourhoods: “Nearest Neighbours” vs “Face Neighbours”
Apart from the different and complicated shapes of Voronoi regions for different lattices, another issue is to
define a neighbourhood
. The “nearest neighbours” in terms of distance from a lattice point may be different from “face-neighbours” (whose Voronoi cells touch the faces of the Voronoi cell of the lattice point under consideration). For example, a Body-Centred Cubic lattice has 8 nearest neighbours but the Voronoi region has 14 faces (which is formed by incorporating the 2nd nearest neighbours as well). For some cases, like the Primitive Cubic and the Face-Centred Cubic, the nearest neighbour lattice points and the face neighbour lattice points would be the same. However, in general, they may be different. I have described two such examples below (the left one corresponds to the nearest neighbour in terms of distance and the right one corresponds to face neighbours).
Body-Centred Cubic
Body-Centred Tetragonal
Defining Custom Cellular Automata Rules
The built-in CellularAutomaton function cannot be used here because of the complicated neighbourhoods of Voronoi regions. The built-in function can be used only with cubic neighbourhoods (or general parallelepiped) for which there are only 6 faces of the unit cell. Thus, I defined a very basic “outward growth” CA according to which a Voronoi region will be allocated a state of “1” if any one of its neighbours has a state “1.” This was run on both cases of neighbourhoods (nearest neighbours and faces of the Voronoi cell). Below are some examples of the evolution of a few steps of the CA (first image is the initial condition).
Face-Centred Cubic
Primitive Cubic
3D Analogue of ArrayPlot for Voronoi Regions
We can create a function which is similar to the task of implementing a 3D analogue of the built-in ArrayPlot function for unit cells. However, this time, lattice points and their Voronoi regions would be highlighted instead of the conventional parallelepiped unit cell. The input to the function (latticeVoronoiPlot) are the basis vectors and the dimension of repeating the lattice points. The lattice points (and their corresponding Voronoi regions) to be highlighted are supplied in the form of indices as an option. The code and the example of a Primitive Hexagonal lattice is presented below.
C
o
d
e
:
l
a
t
t
i
c
e
V
o
r
o
n
o
i
P
l
o
t
[
{
{
1
,
0
,
0
}
,
{
3
,
S
q
r
t
[
3
]
,
0
}
/
2
,
{
0
,
0
,
1
}
}
,
{
3
,
3
,
3
}
,
p
o
i
n
t
s
T
o
S
h
o
w
{
{
1
,
1
,
1
}
,
{
2
,
2
,
2
}
}
]
(
*
t
h
e
o
p
t
i
o
n
a
l
a
r
g
u
m
e
n
t
p
o
i
n
t
s
T
o
S
h
o
w
s
p
e
c
i
f
i
e
s
t
h
e
i
n
d
i
c
e
s
o
f
t
h
e
l
a
t
t
i
c
e
p
o
i
n
t
s
t
o
b
e
h
i
g
h
l
i
g
h
t
e
d
*
)
O
u
t
[
]
=
l
a
t
t
i
c
e
V
o
r
o
n
o
i
P
l
o
t
[
{
{
1
,
0
,
0
}
,
{
3
,
S
q
r
t
[
3
]
,
0
}
/
2
,
{
0
,
0
,
1
}
}
,
{
3
,
3
,
3
}
]
(
*
w
i
t
h
o
u
t
t
h
e
o
p
t
i
o
n
s
,
a
s
p
a
c
e
-
f
i
l
l
i
n
g
r
e
g
i
o
n
b
y
s
t
a
c
k
i
n
g
t
h
e
V
o
r
o
n
o
i
c
e
l
l
s
a
r
e
d
r
a
w
n
*
)