• No se han encontrado resultados

3.6 MEDICIÓN DE LOS PROTOCOLOS MQTT-SN Y COAP

3.6.3 Metodología de medición de los protocolos MQTT-SN y CoAP

All methods discussed in this section can be applied to both 2D and 3D CETSP instances.

5.4.1

Branching vertex selection

The branching vertex selection used in Cout differs depending on the radii of the covering regions. When the radii are constant, for a given sequence S and tour T ∗ (S), the algorithm computes the smallest distance from each vertex to all edges in the tour, represented by ˆdv for vertex v, and pick the vertex with the largest distance to be

the node inserted into the tour. For example, in Figure 5.2a, the smallest distance from both uncovered vertices 1 and 2 are to the edge between covering region 3 and 4, represented as ˆd1 and ˆd2 respectively. Since ˆd1 > ˆd2, the algorithm will pick vertex 1

to be the next branching vertex.

On the other hand, when radius of covering regions are arbitrary, Cout uses a different branching variable selection method. For each vertex v, the algorithm finds the smallest value of ˜dv = ˜ev1+ ˜ev2− eij where eij is the length of the edge from vertex

i to vertex j, and ˜ev

1+ ˜ev2 is the shortest sum of distances from a point on the covering

region of v to the end points of the edge from vertex i to vertex j. Then the vertex with the largest ˜d value is the branching vertex. For example, in Figure 5.2b, since

3

4

0 1

2

(a) Constant radii

3 4 0 1 2 (b) Arbitrary radii

Figure 5.2: Branching variable selection methods ˜

d2 > ˜d1, vertex 2 is the branching vertex.

We propose a simple change to the scheme that uses the value ˆd0v = ˆdv − rv which

is the difference between the distance ˆdv and the radius of the corresponding covering

region. This is the same scheme as the one in Cout when the instance has constant radii, and a slightly different one from Cout when the radii are arbitrary. We will show in Section 5.5 that this brings a substantial improvement to the performance of the B&B algorithms on instances with arbitrary radii.

5.4.2

Reduce the number of vertex coverage checks

The process of checking the feasibility of an optimal tour of a partial sequence (line

14 of Algorithm 6) involves checking whether all vertices not in the partial sequence is covered by the corresponding optimal tour. To correctly check the coverage of a vertex by a tour, it is necessary to check the covering region of the vertex against each edge in the tour to see if intersection occurs. However, since a child node is a partial sequence that differs from the partial sequence of its direct parent node by a single vertex inserted into the sequence, most of the turning points associated with vertices

far from the inserting position may not change from a parent node to a child node. Let a child sequence be created by inserting some vertex after the kth vertex in

the parent sequence. Then a vertex in the parent sequence is said to be a steps away from the inserting position for some non-negative integer a, if it is covered by an edge starting from the (k − a)th vertex in the optimal parent sequence tour.

Given the observation that most turning points in the tour do not change from a parent node to a child node, we can reduce the number of coverage checks by the following method: if a vertex not in the sequence is covered by an edge of the optimal tour of the parent node more than a steps from the inserting position in the current child node sequence, we assume that it is still covered.

Note that it is possible for such a vertex to not be covered by a tour when we assume it is, as the tour may change substantially from a parent node to a child node. Therefore, when the check indicates that all nodes are covered by the current tour, an additional check is set to confirm coverage of all vertices not in the sequence. The child node can be inserted back into the search tree, if it turns out that not all vertices are actually covered. This does not affect the ability of the B&B algorithm to prove optimality, since the child nodes inserted back into the tree now have correct coverage information.

On the other hand, if a vertex not in the sequence is covered by an edge of the optimal tour of the parent node no more than a steps away from the inserting position, we can check its covering region against only the edges close to the inserting position. If it is still covered, we do not need to check it against other edges; but if it is not covered by the edges we checked, we can then check the covering region against all other edges in the current tour.

After some testing, we determined that a can be set to 1, which resulted in notice- able reduction in the number of vertices to check while not causing significant increase

in the chance of a coverage error (which will lead to more number of nodes explored).

5.4.3

Find better feasible solutions

The quality of the feasible solutions found is another aspect of the algorithm that can be improved. Given a feasible solution to a CETSP, the tour T must intersect with the covering regions of all vertices for at least one point. Therefore, we can obtain a set of points consisting of one intersecting point per covering region, which can be used to construct a conventional TSP. Then we have the following lemma.

Lemma 5.1. If an optimal tour TC∗ for the constructed TSP is shorter than T , then that tour is a better feasible solution to the CETSP. Furthermore, if we then solve an SOCP problem constructed with the optimal sequence S∗

C of the TSP, the resulting tour

will be at least as short as T∗ C.

Proof. Since the TSP is constructed using an intersecting point of each covering region, any feasible solution to the TSP is a feasible solution to the CETSP. If TC∗ is shorter than T , it must be a better feasible solution to the CETSP than T .

Since the tour TC∗ is only a feasible solution for the CETSP with the sequence SC∗, optimal solution to the SOCP problem, which is the optimal tour of the sequence SC∗ for the CETSP, will be at least as good as the optimal solution to the TSP. 

Lemma 5.1 suggests that we can potentially find better feasible solutions to the CETSP by constructing and solving a TSP based on an existing feasible solution to the CETSP, and solve an SOCP problem to obtain another feasible solution to the CETSP. The process can be repeated with a new set of intersecting points based on the optimal tour for the SOCP problem, until no better tour for the TSP based on the intersecting points can be found.

For this improvement to work efficiently, we used Concorde [4] as it is considered to be the state-of-the-art for solving symmetric TSP [12]. Since Concorde takes integer distance value, we multiply all distances by 100000 and round to integer values. Since we are only interested in the sequences produced by Concorde, the loss of precision caused by rounding is not going to affect the CETSP tour length.

Note that the choice of the intersecting points can affect the symmetric TSP so- lution. For our algorithm, we used the first intersecting points with the tour for each covering region belonging to vertices that are not in the partial sequence. For the vertices that are in the partial sequence, the corresponding turning points are used.

5.4.4

Improve lower bound

A major issue that affects both Cout and Cout-CBFS is the space needed to store the unexplored nodes. On problems that require exploring a large number of partial sequences, the number of unexplored nodes can increase exponentially. Therefore, a probing method is used to further reduce the number of unexplored nodes that needs to be stored at any given moment during the search.

In particular, given a node S selected for exploration, we first apply a limited BFS search with that node as the root. There can be two outcomes from the short search: either the search terminates with the entire subtree rooted at S explored, or the search terminates with some nodes on the subtree rooted at S still unexplored. If the first scenario occurs, the current node can be pruned. When the second scenario occurs, we first tried to simply take the still unexplored nodes generated and insert them back into the original search tree. However, it turned out that this also generated unexplored nodes too rapidly and was unable to address the space constraint issue. We then determined that the best approach is to keep some information (on vertex coverage and the SOCP solution) about each node generated during the search so that when

the same nodes are regenerated outside of the brief search, the stored information can be used to avoid repeated computation. We will refer to this method as a look-ahead search, or LAS for short.