Urban Free-Space Optical Network Optimization

: This paper presents a set of graph optimization problems related to free-space optical communication networks. Such laser-based wireless networks require a line of sight to enable communication, thus a visibility graph model is used herein. The main objective is to provide connectivity from a communication source point to terminal points through the use of some subset of available intermediate points. To this end, we deﬁne a handful of problems that differ mainly in the costs applied to the nodes and/or edges of the graph. These problems should be optimized with respect to cost and performance. The problems at hand are shown to be NP-hard. A generic heuristic based on a genetic algorithm is proposed, followed by a set of simulation experiments that demonstrate the performance of the suggested heuristic method on real-life scenarios. The suggested genetic algorithm is compared with the Euclidean Steiner tree method. Our simulations show that in many settings, especially in dense graphs, the genetic algorithm ﬁnds lower-cost solutions than its competitor, while it falls behind in some settings. However, the run-time performance of the genetic algorithm is considerably better in graphs with 1000 nodes or more, being more than twice faster in some settings. We conclude that the suggested heuristic improves run-time performance on large-scale graphs and can handle a wider range of related optimization problems. The simulation results suggest that the 5G urban backbone may beneﬁt signiﬁcantly from using free-space optical networks.


Introduction
Free-space optical (FSO) communication is an optical point-to-point communication technology. This type of model is based on light propagating in free space (air, outer space, or vacuum) for wireless transmission of data.
The FSO communication involves the use of modulated optical or laser beams to send telecommunication information through the atmosphere. The concept of light communication is not new; Alexander Graham Bell first introduced it in 1880. He demonstrated the use of an intensity-modulated optical beam to transmit telephone signals through the air to a distant receiver. Modern FSO commonly makes use of narrow laser beams to maximize the distance and bandwidth; therefore, it also is referred to as "laser-com". For a general survey on FSO, see in [1].

Related Works
In recent years, the demand for fast and available communication in urban and rural regions has increased with the rise in the use of social networks and Internet of Things devices. Therefore, a growing research has focused on optimizing communication networks. However, this paper addresses a set of network optimization problems that are relatively new. Shang et al. [9] suggested a dynamic selection of communication facilities for creating connected and full-coverage networks. In their study, they used the bounded-degree nodes, instability link, and labile topology of the FSO model to build an optimization algorithm using a Voronoi diagram. Gu et al. [10] suggested a proactive network reconfiguration algorithm for FSO-based fronthaul and backhaul networks. Their algorithm used mixed-integer nonlinear programming to optimize network power consumption. Those works discussed optimization of data collection from multiple sensors, made possible by the use of small low-voltage transmitters with long-term communications and precise targeting capabilities. In this paper's research, however, only two conditions are required for FSO network modeling: (1) LOS field restrictions and (2) the cost function over the nodes and FSO links.
The problem of optimizing graphs presented in this work is commonly addressed as a facility location problem (see [11] for a comprehensive research regarding facility location and [12] for a recent survey on multi-criteria location problems). The classic form of this problem is defined on a graph with fixed-weight edges. The goal is to find the optimal solution (a set of vertices) for a set of facilities.
A different approach to this classic model addresses the allocation of facilities on a graph with dynamic weights on the edges [13]. In other words, the alternate approach searches for an optimal registration to the graph's edges, considering all its vertices rather than searching for subsets of optimal vertices. Another related model considers finding a set of minimal vertices in a graph representing antennas on the terrain. That model defines two types of vertices in the graph, representing two types of facilities: base stations (BS) and relay stations (RS). The goal is to find a minimum set of RS that connects all the BS. The motivation for this problem is to minimize the number of antennas that must be deployed on the terrain. This problem was proven to be MAX SNP-hard (i.e., no constant approximation factor) [14]. This paper discusses a related scenario. Instead of using BS and RS, it considers a visibility graph (representing a city map) with potential and demand vertices and weights on the edges and on the vertices.
Another set of problems addressed is the protocol of communication flow from the sink nodes to the leaves on an existing network while supporting longer network life. These flow problems customarily have been used in sensor-based network models where every node has limited energy. Most work on this subject dealt with the question of how to choose proper cluster head (CH) nodes in the network graph. A CH node is responsible for collecting data from the sensors and transmitting it via relay nodes. Traditionally, this problem has been solved by generating stable clusters in the mobile environment, for example, through the lower energy adaptive clustering hierarchy protocol. This grade-routing protocol uses a randomized rotation of local CHs to achieve an even distribution of energy in the network [15]. More recent research has suggested that, in many real-life cases, genetic algorithms (GAs) might lead to improved network performance [16]. In this work, the main purpose is to construct an efficient network in which the data can flow using minimum cost. In other words, instead of choosing the right CH, we want to choose the nodes that best centralize the data transmission in their area. In the network graph, that means finding the right nodes to not only cover an equal area (nodes), but also minimize the cost of this group of nodes.
From the graph theory point of view, the suggested problems discuss algorithms that evolve around edge connectivity, max flow, and a dominating set on a graph. These problems are known to be codependent. For example, computing graph connectivity calls up a max-flow subroutine and is optimized by first finding a proper dominating set. Many heuristic algorithms for finding graph-edge connectivity use max-flow subroutines. Even and Tarjan [17] suggested using such algorithms. Other works, such as those in [18][19][20][21], improved their algorithm complexity to O(mn) for a graph with n vertices and m edges by finding some small (but not necessarily optimal) dominating set D of the graph G and using amortized complexity on the computation λ for the vertices of that set. This current work uses those algorithms to build and evaluate solutions for the FSO network-optimization problem. Most theoretical problems described in the previous paragraph have been proven NP-hard, meaning we cannot compute an optimal solution for them in polynomial time. Nevertheless, some heuristic algorithms can provide a close solution in efficient run time.
One common heuristic used for network optimization is GA. Holland proposed this method in 1973 [22] as an evolution-based stochastic optimization algorithm with a global search for generating useful solutions. The GA is an example of a large family of heuristics called evolutionary algorithms. Inspired by biological evolution, they mimic the behavior of population survival. The algorithms are iterative and contain methods inspired by the processes of development, reproduction, selection, and natural selection (according to principles of Charles Darwin's survival of the fittest theory). This study addresses some network optimization problems induced by the Steiner tree problem for graphs. Given a weighted graph with a subset of vertices S, the Steiner tree problem is to find the minimum-cost subtree that spans all vertices in S [23]. Kapsalis et al. developed a simple implementation for the GA to solve the Steiner tree problem for graphs [24]. The initial population for their algorithm was a random minimum spanning tree (MST) of the original graph and a time limit of 4000 s to reach solution. Their algorithm reached an approximation of 7.3% from the optimal solution. The Euclidean Steiner tree problem is defined as follows. Given n points on the plane, connect all the points by lines of minimum total length in such a way that any two points may be interconnected by line segments either directly or via other points and line segments. For the Euclidean Steiner tree problem, there exists a GA implementation [25].

Our Contributions
This paper presents a general framework for optimizing FSO urban networks. The ever-growing demand for bandwidth requires frequent upgrading of the transport layer of networks, in particular in dense cities and urban regions. Using FSO for backhauling allows a cost-effective alternative to fiber-optic cables and RF links. FSO requires neither frequency licensing nor performing road construction, which are both expensive and time consuming. Therefore, the use of FSO in urban regions may increase dramatically along with the adaption of 5G technology. In this paper, we present a generic method for optimizing large-scale FSO networks. The suggested heuristic is based on genetic algorithm. Simulation results show that it often outperforms the existing Steiner approximation algorithm [26] as implemented in the Networkx package [27]; the genetic algorithm has better run-time performance on real-world scenarios (above 1000 vertices). Moreover, most importantly, the suggested algorithm is applicable on a wide range of network constrains and problems, while the existing algorithms for the Steiner problem are only applicable for the simplified version of the FSO optimization problem. To the best of our knowledge, this is the first paper that suggests a generic optimization method suitable for solving multi-constraint real-world FSO problems.

Problems Statement
This section presents the main optimization problems related to the construction of FSO networks. A core component in any FSO-related problem is the visibility graph [14,28,29], in which a vertex (node) represents a point on the terrain, and an edge represents a link between two points with LOS between them.
Herein, an FSO graph is defined as a visibility graph with red and blue vertices [26]. Next, we present five optimization problems of interest in the context of constructing FSO networks, followed by some required definitions and models:

1.
Given a visibility graph, find the spanning tree (network) with maximum endpoints (leaves).

2.
Given an FSO graph, find the network with minimum intermediate points that connects all terminal points.

3.
Given an FSO graph with positive-weighted vertices, find the network with minimum overall node cost that connects all terminal points.

4.
Given an FSO graph with positive-weighted edges, find the network with the minimum overall edge cost that connects all terminal points.

5.
Given an FSO graph with positive-weighted vertices and edges, find the network with the minimum overall (combined node and edge) cost that connects all terminal points.
To formalize the above problems, we define the following preliminaries.
• Terrain: τ, 2-dimensional (D) function from (x, y) → z where (x, y) is the location on the terrain and z is the height of this point.

•
Building P: a 2.5D polygon on the terrain with height from the ground. • Line of sight: Between two buildings, there is LOS (i.e., visibility) if and only if there is a straight line between them that does not intersect any other building on the terrain.

•
City map: Subcase of a terrain that represents an urban canyon (2.5D polygons). In this work, we consider the ground to be flat terrain and the buildings to be of rectangular shape, each with a positive height z from the ground.

•
Terminal points, denoted as B: The subset of buildings that require communication (blue vertices). The distance between these buildings is not longer than a predefined maximal range.
We now define the main graph model used in this paper, the FSO visibility graph model. The visibility graph is an undirected graph defined by the binary function FSO link . The following types of simple graph models enable us to define our problems of interest ( Figure 1), demonstrating the visibility graph on a group of buildings.

•
Let G v = (V, E) be a visibility graph, which is an undirected graph. This graph is defined by the binary function FSO link on a terrain τ, where each vertex represents a building.  Next, we formally define the problems in focus and discuss their computational complexity (hardness state). We rely on the observation that every regular graph can represent a visibility graph on some terrain and deduce the problem complexities from the regular graph case. For visibility graph complexity analysis, see Section 2.6.

Network with Maximum Number of Terminal Points
The problem of finding a network with the maximum number of endpoints serves as the baseline problem in this paper. It is motivated by the property of endpoints being less expensive in "real-world" FSO scenarios. This problem is known in the literature as the max-leaf problem. Definition 1. For a graph G v = (V, E), find a spanning tree with maximum leaves, where a leaf is a vertex with only one adjacent vertex. Figure 2 demonstrates the max-leaf problem on a small graph. The max-leaf problem is known to be NP-hard [30]. There is a polynomial-time algorithm for a graph with maximum degree 3 [31]. In our case, the visibility graph is often dense, and the maximum degree is not bounded by 3. Furthermore, the general max-leaf problem has no polynomial-time approximation scheme, meaning no algorithm can give an infinitely close solution for this problem, assuming P = NP . However, there exists a 2-factor approximation in polynomial time for this problem. In this scenario, a solution that contains up to two times the amount of nodes than necessary is not reliable. There is also a solution with reasonable run time for this problem in small graphs of up to 50 nodes [32]. Moreover, such an assumption is inapplicable in many urban visibility graphs.

Connected Network with Minimum Number of Intermediate Points
This scenario includes some terminal points (blue vertices) in the city that need to be connected and some optional intermediate points (red vertices) that may be used as relays to enable connectivity. This problem is motivated by the need to place new infrastructure at the chosen intermediate points.

Definition 2.
Given a red-blue visibility graph G rb = (B, R, E), find a spanning tree that contains all vertices in B and a minimum number of vertices in R. The solution for this problem is aĜ rb with minimum number of red vertices R (E depicts the induced edges of graph B ∪ R ). Figure 3 provides an example of such a problem. Two possible solutions are depicted in Figure 4.  The complexity of this problem (on general graphs) is known to be NP-hard [14].

Network with Minimum Vertex Cost That Connects All Terminal Points
Here, the previous problem is extended by adding weights to the vertices in the G rb graph. This problem is motivated by the fact that the cost of placing the infrastructure may vary among different intermediate points; for instance, the building owners may demand different payments for using their roofs.

Definition 3.
Given a red-blue visibility graph G rb = (R, B, E) and a vertex cost function w (v) : R → R, find a set of vertices R ∈ R of minimal overall cost that connects all the vertices in B. The solution for this problem is aĜ rb with arg min v∈R ∑ w (v).
The previous unweighted variant can be reduced to the weighted variant herein by setting all vertex costs to 1. Thus, following the hardness of the unweighted variant [14], the weighted variant is also NP-hard (on general graphs).

Network with Minimum Edge Cost That Connects All Terminal Points
We now consider a similar problem to the previous, with the difference that costs are applied on edges rather than on vertices. Applying costs on the edges is motivated by the need to place different FSO hardware for different scenarios (e.g., distance or density).

Definition 4.
Given a red-blue visibility graph G rb = (R, B, E) and an edge cost function w (e) : E → R, find a set of edges E ∈ E of minimal overall cost that connects all the vertices in B, possibly using some red vertices R ∈ R. The solution for this problem is aĜ rb with arg min e∈E ∑ w (e). This problem is also known as the Steiner tree problem for graphs. Note that the problem's optimal solution is not necessarily a graph that connects all terminal points with the minimum possible number of edges. This is illustrated by the example in Figure 5. The Steiner tree problem for graphs is NP-hard (on general graphs), and its decision variant is known as one of Karp's 21 NP-complete problems [33]. The problem has a polynomial-time approximation of factor ≈1.39 [34]. Several heuristic algorithms were proposed for this problem throughout the years [26].

Network with Minimum Combined Vertex and Edge Cost That Connects All Terminal Points
The most general problem we consider applies costs to both vertices and edges. The motivation for this problem is clear: Costs in real-life scenarios may be applied to both vertices (placing infrastructure) and edges (varying required FSO hardware).

Definition 5.
Given a red-blue visibility graph G rb = (R, B, E), a vertex cost function w (v) : R → R, and an edge cost function w (e) : E → R, find a set of vertices R ∈ R and a set of edges E ∈ E that connect all the vertices in B with minimal combined vertex and edge overall cost. The solution for this problem is aĜ rb with arg min v∈R ,e∈E (∑ v∈R w (v) + ∑ e∈E w (e)).
The Steiner tree problem for graphs can be reduced to the general problem herein by settings all vertex costs to zero. Thus, following the hardness of the Steiner tree problem for graphs, the general problem is also NP-hard (on general graphs).

General Properties of the Visibility Graph
We present a lemma showing the visibility graph model to be as general as a regular undirected graph. As mentioned, the optimization problems of max-leaf and Steiner tree on graphs are NP-hard. In this subsection, we show that every graph can be represented as a visibility graph on some terrain. Moreover, such terrain and its corresponding visibility graphs can be computed efficiently.

Lemma 1.
For any graph G < V, E >, there exists a terrain τ (of size O(|E| + |V|)) and a geometric embedding V τ of V on τ. The visibility graph of V τ over τ is the same graph as G.
Proof. By construction: The visibility graph can be constructed by starting from a null graph, where all the vertices are located on the outer boundary of a thin n-edges polygon. For each two vertices (u, v) that are connected in the graph, a narrow "window" (white "segment") is created between u, v to allow visibility between them without changing the other visibility relations. Such construction has an O(E) size, as each additional edge adds two segments to the polygon. The construction is demonstrated in Figure 6. . Visibility graph representation on a simplified terrain. Left: a graph. Mid: the vertices are located on a polygon of n edges; the black polygon represents a "wall". Each edge e(u, v) in the graph is marked as a (blue) segment in the polygon. Right: each visibility segment is marked in white to allow a "visibility window" related to each edge in the graph. Corollary 1. The visibility graph model is equivalent to the general undirected graph model.

A Genetic Algorithm for FSO Communication Networks
This section presents an algorithm for creating connected FSO networks. As discussed in the previous section, the FSO problems at the focus of this paper are NP-hard. Consequently, there is no known algorithm for computing the optimal network in a reasonable time (for large networks). However, possible solutions for hard problems on graphs can be produced with low run time by applying heuristic methods [24]. The fast computation issue becomes all the more important due to dynamic changes that commonly occur in FSO networks, which are inherently sensitive to changes in climate and demand. For example, an office building may have great demand in the daytime, but most of the demand moves to nearby residential buildings in the evening. Another example is when fog blocks the LOS.
Bio-inspired algorithms are a family of heuristic methods that simulate biological processes that exist in nature, such as the immune system, viral systems, and insect swarms. Evolution is the biological process that inspires GAs, which simulates DNA growth and mutation in cells. Next, we present a GA for solving the FSO problems at hand. The GA consists of a set of solutions, termed population, that iteratively changes for a given number of rounds (generations), after which the most fitting solution is obtained. The algorithm consists of five essential elements:

1.
Population initialization: This element, which constitutes the first stage of the algorithm, generates a set of possible valid solutions to the problem. This set of solutions is termed the initial population.

2.
Crossover (merging): This element is an operator that receives as input two possible solutions and creates a new solution that combines the two. The idea is to improve the two solutions by taking valuable features from each (similarly to DNA).

3.
Mutation: This element adds random changes to each solution. As in the biological process, the mutation operator creates arbitrary changes to a solution. These changes can create a high-grade solution that is unlikely to result from the crossover operator.

4.
Evaluating solution: This element, often termed the fitness function, grades each solution. The grade determines the solution's quality, which affects the probability that the solution will survive to the next generation. For example, a fitness function on a weighted graph can be the sum of the edge/vertex weights.

5.
Selection: This element is in charge of selecting the next generation of solutions according to their fitness score. The new population obtained from the selection process is further evolved by repeating the crossover and mutation steps and so forth.
The basic GA structure is illustrated in Figure 7. The following subsections present a GA that has been specifically designed to solve the described FSO problems.
Before proceeding to the details of the algorithm, we first present some notations: where E is the number of edges in G, by applying the DFS algorithm.
• Let SP(v 1 , v 2 ) be the shortest path between two vertices v 1 and v 2 . The shortest path is represented by an ordered set of vertices and edges in a graph. Accordingly, SP(v 1 , G 2 ) represents the shortest path between vertex v 1 and some vertex in the subgraph G 2 . In a slight abuse of notation, we denote by |SP(·)| the length (number of edges) of the path SP(·).

Generate Initial Population
The first stage of the algorithm is to generate a set of solutions (namely, graphs) that constitutes the first generation (i.e., the initial population). This is an important step because generating high-quality solutions for the initial population can significantly affect the quality of subsequent generations.
The f irstGeneration process, described in Algorithm 1, begins with an empty set of solutions (line 1) and an initial graph G init , which is the induced subgraph of a graph G for vertex subset B (line 2). G init constitutes the basic graph from which all the k initial solutions are generated.
In most realistic settings |B| |R|, thus G[B] is most probably not connected. Therefore, to generate a population of valid solutions, the solutions must be such that all B vertices are connected. To that end, randomConnect (see Algorithm 2) ensures that a solution is indeed "blue-connected" by invoking a stochastic process that commences from the sink s (Algorithm 1, line 4). Such a mode of operation enables adding k valid and possibly different solutions to the initial population (lines 3-6). Figure 8 illustrates the creation of two valid initial solutions. Algorithm 2: Pseudocode of randomConnect, which iteratively adds blue vertices and connects them to the graph until a valid solution is obtained.
Input: G = (R, B, E) red-blue visibility graph, a possibly invalid (unconnected) subgraph G init , and a sink vertex s ∈ B. Result: A connected red-blue visibility subgraph G ⊆ G.
The randomConnect process, presented in Algorithm 2, is a core ingredient in the GA scheme proposed herein. It is invoked in the generation of not only the initial population, but also subsequent generations, so as to validate solutions after the crossover and mutation operations (explained in the next subsections). Thus, randomConnect is designed to be robust and fast. It starts with G , which is the connected component in G init that contains the sink vertex s (Algorithm 2, line 1). Next, the connected component G is iteratively extended until it contains all the blue vertices (lines 2-6). Each such iteration consists of three steps: (1) choose a blue vertex v that is currently not in G (line 3), (2) find a random path to this vertex from G (line 4), and (3) update G (line 5). The first two steps are random, which enables generating different solutions. A more elaborate discussion on these three steps is given after the following observation. Once a new blue vertex v ∈ B \ V(G ) is selected, it needs to be connected to G . Algorithm 3 describes the process of adding the path to that vertex. For the sake of randomness, a relay vertex v ∈ V(G \ G ) is chosen, through which the path to v shall pass. However, this may lead to long and inefficient paths and eventually to poor solutions when a distant vertex (from the shortest path between v and the connected component G ) is chosen instead of other more appropriate relay vertices. Thus, only vertices that lead to a path at most d hops long (|SP (v, v )) | + |SP (v , G )) | ≤ d) are considered (Algorithm 3, lines 1 and 3). Ultimately, a relay vertex v is randomly chosen from the set of valid options (line 6), and the resulting (shortest) path P that goes through v is returned (lines 7-8). Finally, the path P is added to the graph G (Algorithm 2, line 5).

Algorithm 3:
Pseudocode of f indPath, which finds a random path connecting a new vertex to a graph.
Input: G = (R, B, E) red-blue visibility graph, a subgraph G ⊆ G, and a vertex v. Result: A path P ⊆ G. let d be a predefined maximal path length, such that d ≥ |SP Figure 9 illustrates the randomness of f indPath by showing two possible ways to connect a new vertex v. The above randomConnect constitutes a constructive process of gradually adding vertices (and the paths that connect them) to the connected component of the sink vertex s until a valid solution is obtained. Another possible approach is to apply a destructive process, in which red vertices are gradually removed from the initial graph G, as long as the graph remains valid (i.e., "blue-connected"). In real-world FSO applications, there are commonly many more red vertices than blue ones; thus, the constructive approach has been chosen herein.
The randomConnect process is used not only in f irstGeneration, but also in the construction of subsequent generations to ensure the validity of obtained solutions.

Creating the Next Generation
Evolutionary algorithmic schemes such as GA simulate the change of population by creating generations of solutions. The formation of each new generation in the GA herein is performed by a process called nextGeneration. The goal of this process is to create increasingly stronger solutions in every round (generation) by attempting to produce strong new solutions that are based on solutions from the previous generation and on eliminating weak solutions. New solutions are obtained by invoking the crossover and mutation operators. Subsequently, the f itness function evaluates the quality of these newly obtained solutions. Finally, the new generation's population is selected according to the calculated fitness scores of the obtained solutions. The iterative flow of nextGeneration is depicted in Figure 10. Denote by Gen i = g 1 , . . . , g k the popuation of solutions of the current generation i. The population of the next generation Gen i+1 is a set of solutions with the following attributes; (1) |Gen i+1 | = |Gen i | = k; (2) Gen i+1 will contain solutions from Gen i with the addition of new solutions obtained by using the crossover and mutation operators; (3) to obtain "strong" genes, the resulting k most-fit solutions will be chosen for Gen i . Algorithm 4 presents the pseudocode of the nextGeneration process. The above observation holds because all the m newly obtained solutions through crossover and mutation join the k original solutions of the current generation Gen i , before the next generation Gen i+1 is formed from the top k solutions (of the m + k possible solutions). Consequently, in the worst case, all newly obtained solutions are "worse" than the original k solutions of Gen i , leading to Gen i = Gen i+1 . Otherwise, the population Gen i+1 is strictly better than Gen i . The observation makes the present GA an "anytime" algorithm [35], which is a key feature for heuristic algorithms.
The nextGeneration process is invoked for a given number of times, according to the predefined number of generations (see Figure 7). Nevertheless, the anytime feature enables deciding at any point whether to continue the process or settle for the current best solution without the risk of ending up with some temporary bad solution.

Crossover Operator
The crossover operator produces new solutions for the next generation. It takes two solutions (graphs) and produces a new solution that is a combination of them. The crossover operator receives two valid red-blue visibility graphs G1, G2, and outputs a new graph G that is also valid (i.e., "blue-connected"). The GA activates the crossover operator repeatedly; thus, it needs to be computed quickly. The crossover operator is formally described in Algorithm 5.
In line 1, the red vertices of the two input subgraphs are intersected to obtain the set of mutual red vertices R . Such an operation of combining the two inputs is the essence of the crossover because it preserves the "genetic" attributes of the parents' "genes". Next, the blue vertices are added to obtain V (line 2) before devising G , which is the induced subgraph of G (For ease of presentation, the original graph G and the sink vertex s are omitted as inputs in Algorithms 5 and 6.) with the vertices V (line 3).

Algorithm 5:
Pseudocode of the crossover operator.
if G is not blue-connected then G = randomConnect(G, G , s) end return G Algorithm 6: Pseudocode of the mutation operator.
Input: A connected red-blue visibility graph G = (R , B, E ). Result: A mutated connected red-blue visibility subgraph G .
Note that most red vertices in R 1 and R 2 are essential for the respective connectivity of G 1 and G 2 . Therefore, the resulting graph G after the crossover is most probably not "blue-connected". Such a phenomenon is exemplified in Figure 11. If this is the case, then randomConnect is applied to ensure that G is a valid solution (line 5) before it is returned in line 7. Figure 11. Example of an invalid crossover. The right graph is the result of a crossover between the two left graphs without applying randomConnect.

Mutation Operator
The mutation operator adds variance to the solutions. It is activated on the solutions immediately after their creation (through crossover). The mutation operator, presented in Algorithm 6, is motivated by the DNA genetic-mutation effect and is probabilistic in a similar manner.
The mutation is implemented by replacing a randomly selected vertex v (Algorithm 6, lines 1-2) with other randomly selected vertex(ices). This is achieved by invoking randomConnect (line 3), which is both random and fast. Such a mode of operation ensures that the solution G , returned in line 4, is valid.

Fitness (Grade) Function
After changes are applied to solution graphs (through crossover and mutation), the GA needs to re-evaluate their grades to pass the "best" solutions to the next generation (see Algorithm 4, lines 5-9). The GA literature commonly terms this calculation as the f itness function.
In this paper, the f itness function corresponds to the cost of the graph according to the specific problem at hand (as defined in Section 2). This makes the presented GA rather general because it can be adapted to solve any problem in Section 2.2 through Section 2.5. For instance, in case the combined vertex and edge cost is of interest (see Section 2.5), the fitness (grade) of a graph G = (V, E) would be

Results
This section presents the experiments conducted to evaluate the suggested GA optimization framework by modeling large-scale urban visibility graphs and solving the underlying FSO optimization problems using simulation. This section reviews the tools used to implement the visibility graph model presented in Section 2. The GA and implementation discussed in Section 3 are also presented here, followed by the algorithm results on randomly generated graphs and real-world-data graphs.

Simulation Framework
To simulate large-scale visibility graphs efficiently and realistically, the Networkx library tool was used in Python. This library contains a wide range of graph types, among them simple graphs, random graphs, geometric graphs, and weighted graphs. The Networkx package also includes common algorithmic implementations [27]. One example is the implementation of the 2-factor approximation method to the Steiner problem. This research deals with facility-location problems in urban regions. To test the heuristic methods presented in this study, we used the Open Street Map (OSM) platform, an open source geo-database that holds urban information [36]. From this database, we extracted information essential for building visibility graphs on a city terrain, such as building locations and heights. Figure 12 presents a 3D representation of OSM, from which we were able to construct the visibility graph. The visibility graphs were constructed using two main methods: (1) generating random visibility graphs and (2) constructing visibility graphs based on urban data (e.g., open street maps).
All the experiments were run on an Apple MacBook Air with Intel Core i7 processor (quad-core).

Generating a Random Visibility Graph
The first part of the simulation implements a generator for random red-blue visibility graphs. This generator randomly creates graphs while controlling statistical attributes. The importance of such a graph generator is its ability to produce large numbers of graphs while controlling essential parameters, such as edge density and average graph sizes. These graphs were the basis for a variety of experiments.
The random graphs we generated vary in two primary parameters: • Graph size (number of vertices).

•
Graph density (derived from the maximal range capabilities of the FSO links).
The graph size is a key parameter for evaluating the scalability of the algorithm. The number of edges in a graph is also an important parameter to consider, as it significantly affects the algorithm's performance; thus, we also consider the graph density, which is defined by the following formula, where m is the number of edges and n is the number of vertices in graph G. Figure 13 shows example random red-blue visibility graphs. Those examples represent a red-blue graph with different densities, sizes, and red-blue node ratios. In addition to creating random red-blue visibility graphs, we modeled a city terrain in this simulator. The city model has objects representing buildings, building attributes (such as height, location, and shape), and city terrain. On top of this model, we implemented the LOS function (presented in Section 2) and created an LOS geometric-based visibility graph.

Constructing the Visibility Graph Based on Urban Data
The second part of the simulation tests the algorithm on real urban data. Using real urban information modeled as a graph assists in statistical analysis of the city graphs and improvement of the GA. Figure 14 presents an example of such a visibility graph based on urban data of Manhattan Island, from which we took approximately 2000 buildings and 2500 edges; this map is based on OSM.

Genetic Algorithm Experiments
This subsection discusses the run time for various graph sizes with different densities and the improvement over time of the algorithm compared to other known methods. The GA was implemented using several Networkx library methods, for example, Dijkstra's shortest path algorithm.
The experiments for testing the GA is comprised of two parts: (1) comparing the GA to a competing method for solving the Steiner problem and (2) checking the algorithm's run time and cost improvement over time. These experiments are described next.

Comparison with Other Heuristics
The performance of the GA on the Steiner problem was compared to a standard 2-factor approximation method. The Networkx library has an implementation of the 2-factor approximation method, and we used it in our experiments. Figure 15 demonstrates the solutions of the 2-factor method and the GA on an example graph with 10 vertices. For the experiments herein, we generated random graphs with different densities and tested both the GA and the 2-factor approximation method on those graphs. The methods were tested for run-time performance and optimal cost. In the first set of experiments, we tested small graphs with 200 vertices and large graphs with 2000 vertices. For each graph size, we tested different densities. Figures 16 and 17 show the run-time performances of the two methods. The larger setting is limited to graphs with only 2000 vertices due to the run-time restrictions of the 2-factor method. As shown in Figure 17, the GA method exhibits better run time on the graphs with 2000 vertices. This is because the 2-factor method builds and searches over a complete graph (with 2000 vertices), whereas the GA searches for the shortest path in the original graph only, when creating the initial population. Further, in the crossover function, the GA searches for the shortest path in much smaller graphs (the union between the trees). This may have low impact on the run time in small graphs ( Figure 16) but is very significant as the graphs become larger (Figure 17).  Figures 18 and 19 present the resulting average cost difference between the GA and the 2-factor approximation method. A negative cost difference means that the GA finds better (lower-cost) solutions than the 2-factor approximation method. Regions in which the 2-factor approximation method finds better solutions than the GA are colored in blue. Evidently, the GA method finds, on average, better solutions than the 2-factor approximation method on both sparse and dense problems, except for the intermediate blue regions. In urban cases, the graphs are expected to be dense (denser when the city is small, and sparser when the city is large). Therefore, the GA can be efficient for urban graphs. The fact that this algorithm is also faster makes it the preferable method for solving Steiner problems on urban graphs. In an additional set of experiments we tested the performance of the two methods on different size graphs with fixed density (0.15). Figures 20 and 21 show the run time comparison and the differences in solution cost, respectively.
As these experiments show, the GA is more efficient in terms of run time and solution cost on larger graphs. This confirms that the GA method is more suitable for urban visibility graphs, which are usually very large.

Run Time and Solution Quality
To evaluate the algorithm's performance, we generated red-blue visibility graphs in several variations with different graph sizes and densities. Additionally, we conducted experiments to optimize the algorithm's parameters: Our experiments show that the optimal formulas for deciding the initial GA parameters (number of crossovers) is where n is the number of vertices and density(G) is computed according to Equation (2). The mutation function is designed to avoid a local minimum state. Although the function can add variance to the solution pool, this function is not efficient in terms of run time because it searches for the shortest path in the full graph. In the following set of experiments, we activated the mutation function at a probability of 0.01. After fixing the parameters, we tested large graphs for run time and convergence. Figures 22-24 show the expected run time of the GA method on graphs with 4000 to 16,000 vertices.  The experiments show that the run time of the GA is strongly connected to the graph density. As the density grows, the run time increases. This is because the main method in our algorithm is the shortest path method. This method (using Dijkstra's algorithm) searches over all the edges in the graph, and the number of times it is activated is proportional to the graph density.
Next, we tested the algorithm's ability to improve over generations. Figure 25 demonstrates the algorithm's cost reduction over 60 generations on an example graph with 2000 vertices. Figure 26 presents the case of another example graph, in which a significant cost reduction occurs after 580 generations, following a long period of stable generations. The latter example suggests that in some situations it is worthwhile to run the GA for many generations. However, we observed empirically that, in most cases, the GA converges in less than 100 generations.  Table 1 shows the cost reduction of the GA on large graphs with different densities. The cost reduction relates to the difference (in percents) between the GA's final solution and the initial (random) solution.

Results on Real-World Data
Now, we present experimental results of the GA on real-world data. Here, we used the OSM open project data to create visibility graphs based on real building coordinates and LOS computation. The framework built for these experiments comprises of three steps:

•
Get urban data (location of high buildings in a city).

•
Compute the city visibility graph (mainly the LOS between the buildings).

•
Compute the Steiner graph with GA and the 2-factor approximation method.
In these experiments, we used the urban data of Manhattan Island in New York City. Figures 27 and 28 show the results on real-world data in the form of histograms. The experiments were run on 100 urban graphs, each with 2000 vertices, of which 5 are blue (i.e., require communication).
The histogram in Figure 27 shows that the GA does not always return the best solution. However, in most cases, the GA returns better solutions than the 2-factor approximation method. Moreover, the cost differences in favor of the GA tend to be higher than those in favor of the 2-factor approximation method. The histogram in Figure 28 reveals the clear superiority of the GA in run time over the 2-factor approximation method. We also report a series of experiments that we conducted on large-scale graphs (over 4000 vertices). The graphs were generated randomly, but the graph features (such as density and size) were fixed to simulate urban visibility graphs. From the results, we can conclude that for finding a solution to the Steiner problem on these graphs, the GA was efficient and within a reasonable run time. Because the Steiner problem is NP-hard, we could not test the GA method against the 2-factor approximation method (which demands O(V 3 ) run time). However, the experiments did show that the GA can reach solutions with up to 80% cost reduction. This fact shows that the algorithm is more efficient than simply choosing a solution at random. Another feature of the GA method is the ability to produce "anytime" solutions, meaning we can decide when to stop the algorithm's run and get a solution. Given that running the GA on large graphs can take up to 1500 s, this anytime feature becomes especially helpful in dynamic conditions when weather or demand changes affect the urban network.

Discussion and Conclusions
This paper presents a new method for the urban FSO network optimization problem. The method uses the Genetic Algorithm (GA) approach to find a connected graph among the network components (which represent buildings in the city). Until recently, FSO technology was not commonly used as a backbone urban network, mainly due to the vulnerability of the laser communication technology to extreme weather conditions. Yet, recent improvements in FSO technology has pushed the expected availability ("up-time") of FSO networks from [99-99.9]% to [99.99-99.999]% (from 2-3, 9's to 4-5, 9's) [4,37] allowing the FSO technology to reach service standards required by the urban infrastructure. Thus, the use of FSO in cost-effective 5G networks is expected to increase [37]. The suggested algorithm can be used for both the initial optimal design of an FSO network and for upgrading (adapting) existing FSO network to changes in the network demands and weather conditions. The suggested GA method is designed to create a solution for a variety of problems regarding the minimization of the facilities and infrastructures in urban FSO networks. The algorithm's advantage is considered in two main factors: run time and the "anytime" feature.
As our experiments show, the GA method has no run-time advantage on relatively small (200 vertices) graphs. However, as the graphs increase in size, our method gains a significant advantage over other methods for calculating the Steiner graph. In addition, after correctly setting the algorithm parameters, it appears that the GA can find high-quality solutions. This advantage can be seen in both the random graphs and the real-world graphs examined. The algorithm is shown to have improved performance on visibility graphs representing real cases of urban information (with relatively high density). Based on these results, and because the algorithm is generic for several problems other than the Steiner problem, we can determine that the algorithm proposed here is suitable for finding relatively low-cost networks on urban FSO graphs.
We also observed that the suggested algorithm for finding a connected graph could be generalized to the generic multi-source case. Consider the case of a large city with several internet gateways (a set S of sources). The multi-source problem is defined as follows. Given a graph G =< R, B, E > and a set S ⊂ B (representing the sources), find a subgraph G ⊂ G, in which each vertex in B \ S is connected to one of the vertices in S.

Observation 3.
LetĜ be the graph G with additional edges that connect all the sources. Applying the GA on G will imply a valid (multi-source) solution over G. Figure 29 demonstrates a GA solution on a multi-source graph. Note that because we artificially connected two subgraphs with a single edge of weight 0, we can run the algorithm on each subgraph separately and achieve the same result.
For future work, we plan to examine whether the suggested methods can be expanded to dynamic networks with adaptive weights (costs) on the edges. Another possible generalization of the model is to construct robust two-connectivity solution. Funding: This work was partially supported by the Ariel Cyber Innovation Center in conjunction with the Israel National Cyber Directorate in the Prime Minister's Office.

Conflicts of Interest:
The authors declare no conflicts of interest.