2. Compute P = {P
i
} as the set of points with the
largest visibility indices. However, do not se-
lect two points that are too close together, since
their viewsheds will probably overlap consider-
ably, and hence, some of them will be redundant.
3. Compute V
i
, the viewshed of each P
i
.
4. Initialize S = {}. This will accumulate the set of
actual observers S ⊆ P .
5. Initialize V , the joint viewshed of S , that is, the
union of the viewsheds of all P
i
in S .
6. Repeat the following until a termination condi-
tion is satisfied. Typical conditions require |S| to
achievea certain maximum, or V to achievea cer-
tain minimum of visible points.
(a) Iterate through P to find the P
i
that will cause
the joint visibility index Ω to increase the most.
That involves repeatedly counting the number
of 1 bits in the union of the joint viewshed V
and V
i
.
(b) Insert that P
i
into S and update V .
5 OBSERVER SITING IN GPU
In (Magalh˜aes et al., 2010a) was presented an ex-
tension of the method Site, named Site+, where
some heuristics were included to achieve a same
terrain coverage using fewer observers. In order
to make these heuristics more efficient, the method
SiteGPU (Magalh˜aes et al., 2011) implemented the
following operations in GPU: (1) computing the vis-
ibility index of viewsheds; (2) finding the candidate
observer that will most increase the visibility index
of a joint viewshed; and (3) computing the union of
viewsheds. In this implementation it was used the
following strategy: all data (the viewsheds and joint
viewsheds) were kept in the GPU global memory and
the heuristics were executed on CPU. Thus, the GPU
was used as a coprocessor to efficiently perform oper-
ations requested by the heuristics.
Also, to accelerate the viewshed operations, in
SiteGPU the viewsheds were represented as a small
piece of the terrain matrix. More precisely, each view-
shed was represented by a (2R+ 1) × (2R+ 1) matrix
where R is the radius of interest of the observer which
is sited on this matrix center. That strategy improves
the algorithm efficiency because the points outside the
observer’s radius of interest are not considered, since
they are, by definition, not visible.
The main operation performed by Site+ is the
swap heuristic that tries to increase the joint visibility
index of the current partial solution without changing
the number of observers selected. The basic idea is
to check whether swapping a selected observer (in the
current partial solution) with another observer didn’t
selected yet will increase the joint visibility index.
This checking step considers all pairs composed by
one observer in the partial solution and another one
not in that solution and selects the pair that causes the
highest contribution for the joint visibility index.
Notice that increasing the joint visibility index
of a partial solution can reduce the number of steps
required by the greedy strategy to achieve the final
solution and, thus, the required coverage could be
achieved using a smaller number of observers (that
could be an importantimprovementsince the observer
can be an expensive facility, such as a cellular tower).
But, on the other hand, this local search performs sev-
eral viewshed operations and it is often the bottleneck
of both Site+ and SiteGPU.
In this paper we propose a more efficient method,
named SiteGSM, to site observers on terrain. It is
based on Site+ and includes a faster implementa-
tion of the local search using dynamic programming
and GPU’s shared memory which is much faster than
the GPU’s global memory (used by SiteGPU). It is
important to mention that both methods Site+ and
SiteGSM obtain exactly the same solution, that is,
the same number of observers (sited on same terrain
places) and, of course, the same terrain coverage. The
difference is that SiteGSM is much faster than Site+.
5.1 The Local Search - Swap
Given a set with n candidate observers, let A =
{V
1
, ·· · , V
n
} be the set with their corresponding view-
sheds, that is, V
i
is the viewshed of observer i and let S
be a subset of A with k viewsheds representing an ini-
tial solution for the observer siting problem. The goal
of the swap heuristic is to iteratively change S in or-
der to increase the joint visibility index while keeping
constant the number of observers in S.
The local search method is based on the concept
of neighborhood of a solution which can be defined as
follows: given a solution S =
V
i
1
, ·· · , V
i
k
, a neigh-
bor of S is a solution S
′
where an element of S is re-
placed by another element not in S. See Figure 3. In
each iteration the current solution is replaced by its
best neighbor (the one with highest visibility index).
The process of replacing the current solution with
its best neighbor is repeated until it is obtained a so-
lution having no better neighbor, which is a local op-
timum.
To simplify the notation, a solution S =
{V
i
1
, ·· · , V
i
k
} will be written as S = {i
1
, ·· · , i
k
} in-
dicating that the solution is, in fact, correspond to
ICEIS2014-16thInternationalConferenceonEnterpriseInformationSystems
370