• Nenhum resultado encontrado

APPENDIX C. MORAVAGUI APPLICATION

Figure C.1 The INPUT tab of the application provides the tools to set the graph to be processed

«Compute all using» is pressed down, selecting a metric from the combo box next to the former, will force the computation of all pairs.

Though, if the metric of our choice is not included in the list or some pairs should not be considered, pressing up «Compute all using» enables the spread- sheet.

The «From» and «To» columns hold the indices of the endpoints while

«Weight» holds the weight (or length) of the edge. Again, buttons for adding, removing and clearing all were included.

Also, a button «Add all comb.» provides a useful function: clears the edges list, fill it with all combinations, assigns the weight according to the selected metric. Two examples demonstrate its practicality:

• if all combinations are required except one, one can press the button and then remove the unwanted edge

be reminded that the graphs are not directed: «from» and «to» words are of no mathematical significance

C.4. «Add random vertices» dialog

• if we use our own metric or non–geometric weights, pressing it will pro- duce the pairs with correct indices, allowing us to only type weights and remove unwanted pairs.

Bottom The following three buttons are enabled and meaningful when manually editing the edge list is enabled instead of using the «Compute all using»

function:

• «Verify edges» will inform us about any pathologies in the edge list:

– endpoints with same index – duplicates

– invalid indices (out of range) – invalid weights (out of range)

• «Check if connected» finds if starting from any vertex in the graph there is a path through the defined edges to all other vertices

• «Check if complete» inform us whether the graph is complete by validating that the edge list consists of the expected V(V2−1) pairs.

Create graph button Solidates the vertices and edges into aWeightedGraph

object, accessible by PROCESS and OUTPUT tabs. After that, the user can freely save the file or disable editing by unchecking «Open for edit» – useful to avoid mistakes and free memory – and uninterruptedly operate on the input graph.

Note that the button switches to «Replace graph» when an input graph is ready for use (can be deleted with «Clear all» button in OUTPUT.)

C.4 «Add random vertices» dialog

The ability to add random points can be used for

• validating the application’s and the library’s correctness, time or space complexity etc.

• producing random graphs forhypothesis testingof graphs from observa- tions or simulations

APPENDIX C. MORAVAGUI APPLICATION

(a) Coordinates from independent distributions

(b) Confined in ellipsoid, Poisson point field

Figure C.2 Adding random points can be done in two ways: each coordinate following a certain distribution or the points form a homogenous point field inside an ellipsoid.

• exploringthe properties of random graphs

• adding shot (Poisson) noise in a predefined graph

We currently provide two models of random vertices:

By coordinates the three coordinates follow their own distribution. For example,

C.4. «Add random vertices» dialog forN points:

pi = (xi, yi, zi) X ∼ N(1,10−4) Y ∼ U(−1,1)

Z ∼ U(0,2)

for i= 1,2,· · · , N (C.1)

Depending on the distributions used, e.g. normal, there can be not restric- tion in the population’s volume. Though, in practice, a finite volume is sampled due to the limited range of real number representation in comput- ers and the finite nature of any sample.

Uniform in ellipsoid simulates a Poisson process by creating a homogenous point field. As the volume cannot be infinite, boundaries should be defined.

A common choice is the sphere as it

• reduces edge effects by having the lowest surface area for a given volume and

• imitates observational spatial data: aside from some outlier objects and observational biases we can roughly define a sphere containing most of the data points

But as the process of sampling from a sphere is easily generalized to any ellipsoid, we implemented the general case to accommodate cases like first approximations to star positions in elliptic galaxies, disks in spiral galaxies, etc.

For a tri–axial ellipsoid with axis lengthsa, b, c, centered at the origin of the coordinate system, for any pointP(x, y, z)inside or on the surface,

x2 a2 +y2

b2 +z2

c2 ≤1 (C.2)

If we sampledx, y, zfrom the continuous uniform distributionsU(−a, a), U(−b, b),U(−c, c)for any case other thanabc, the final distribution will not be isotropic and therefore neither homogeneous. Linear density along a direction would depend on its orientation in respect to the axes.

For a truly homogeneous and isotropic spatial distribution, a uniform Poisson point process can be taken using rejection sampling: In other

APPENDIX C. MORAVAGUI APPLICATION words, we can repetitively take random points from a cube containing the ellipsoid by treating their coordinates as random variates of uniform distribution, rejecting those that are outside the ellipsoid.

Obviously, speed is achieved by reducing the probability of rejections, or equivalently the volume of the cube. A simple but not optimal way to do this is to fit the ellipsoid in a cube having its faces parallel to the coordinate system axes and side equal to twice the maximum axis of the ellipsoid.

The optimal way would be to place either of the shape in such way so that the ellipsoid’s major axis is parallel to a diagonal of the cube.

The following steps outline the rejection method for takingN points:

1. Lets= max{a, b, c}

2. Letc= 0

3. Samplex, y, zfromU(−s, s) 4. If xa22 +yb22 +zc22 >1go to Step 3 5. Accept the point: cc+ 1 6. Ifc < N, goto step 3

No documento A user – friendly M inimum S panning T ree (páginas 188-193)