SlideShare a Scribd company logo
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
DOI : 10.5121/ijcnc.2015.7405 75
A GENETIC ALGORITHM TO SOLVE THE
MINIMUM-COST PATHS TREE PROBLEM
Ahmed Y. Hamed1
and M. R. Hassan2
1
College of Applied Studies and Community Services, University of Dammam,
KSA.
2
Computer Science Branch, Mathematics Department, Faculty of Science, Aswan
University, Egypt.
ABSTRACT
One of the important steps in routing is to find a feasible path based on the state information. In order to
support real-time multimedia applications, the feasible path that satisfies one or more constraints has to be
computed within a very short time. Therefore, the paper presents a genetic algorithm to solve the paths tree
problem subject to cost constraints. The objective of the algorithm is to find the set of edges connecting all
nodes such that the sum of the edge costs from the source (root) to each node is minimized. I.e. the path
from the root to each node must be a minimum cost path connecting them. The algorithm has been applied
on two sample networks, the first network with eight nodes, and the last one with eleven nodes to illustrate
its efficiency.
KEYWORDS
Computer networks; Minimum-cost paths tree; Genetic algorithms.
1. INTRODUCTION
The shortest paths tree rooted at vertex s is a spanning tree T of G, such that the path distance
from root v to any other vertex u in T is the shortest path distance from v to u in G,[1]. In the case
of single link failure, [2], proposed an algorithm to solve the optimal shortest paths tree. When
considering multicast tree, [3], the authors presented an algorithm to find the Shortest Best Path
Tree (SBPT). Based on labeling techniques, Ziliaskopoulos et al. in [4], proposed an algorithm to
solve the shortest path trees. Also, The shortest paths tree problem has been solved by an efficient
modified continued pulse coupled neural network (MCPCNN) model, [5].
Heuristic and approximate algorithms for multi-constrained routing (MCR) are not effective in
dynamic network environment for real-time applications when the state information of the
network is out of date, [6]. The authors in [6] presented a genetic algorithm to solve the MCR
problem subject to transmission delay and transmission success ratio. Younes in [7] proposed a
genetic algorithm to determine the k shortest paths with bandwidth constraints from a single
source node to multiple destinations nodes. Liu et al. in [8] presented an oriented spanning tree
(OST) based genetic algorithm (GA) for solving both the multi-criteria shortest path problem
(MSPP) and the multi-criteria constrained shortest path problems (MCSPP). Also, in [9] the
genetic algorithm is used to find the low-cost multicasting tree with bandwidth and delay
constraints.
The paper presents a genetic algorithm to solve the paths tree problem under cost constraint. The
algorithm reads the connection matrix and the cost matrix of a given network. Also, given the
source (root) node s, then the genetic operations are executed to search the minimum cost paths
that construct the minimum cost paths tree rooted at the source node s.
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
76
The rest of the paper is organized as follows: Section 2 presents notations. The problem
description in section 3. The proposed GA and its components are given in section 4. Section 5
provides the pseudo code of the entire GA. Section 6 shows the illustrative examples. Finally,
section 7 presents conclusions.
2. Notations
G
N
E
eij
ce
M
CM
np
Ts
A network graph.
The number of nodes in G.
The number of edges in G.
An edge between node i and node j in G.
The cost of an edge e.
The connection matrix of the given network.
The cost matrix of the given network.
The number of paths from node s to t
The shortest path rooted at node s
3. THE PROBLEM DESCRIPTION
Given a specified vertex s. Let Pi
(s, t) be a path number i from s to t. Let Ci
(P(s, t)) be the cost of the
path Pi
(s, t), i = 1,2, …, np. The path Pk
(s, t) has a minimum cost among all the (s, t)-paths if:
Where
Therefore, the minimum-cost paths tree Ts is the collection of minimum cost paths from the
source (root) node s to the destination nodes ti. I.e.
The presented method in this paper depend on reading both the connection and cost matrices of a
given network, and then find the minimum-cost paths tree rooted at the source node.
Consider the following network with five nodes, shown in Figure 1.
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
77
Figure 1. Five nodes network.
The connection matrix (a square matrix of dimension N x N that represents a connection between
each node-pairs) of the Figure 1 network is:
Figure 2. The connection matrix of network in Figure 1
The cost matrix CM for the network shown in Figure 1 is in the following form:
Figure 3. The cost matrix network in Figure 1.
In Figure 4, we show that the minimum-cost paths tree rooted at node 1 with the minimum cost
equals to 23.
Figure 4. Minimum-cost paths tree rooted at node 1
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
78
4. THE PROPOSED GENETIC ALGORITHM (GA)
In the proposed GA, each candidate path is represented by a binary string with length N that can
be used as a chromosome. Each element of the chromosome represents a node in the network
topology. So, for a network of N nodes, there are N string components in each candidate solution
x. Each chromosome must contain at least two none zero elements.
For example if N = 8, the path of Figure 5 is represented as a chromosome as shown in Figure 6.
Figure
Figure 5. A candidate Path.
1 2 3 4 5 6 7 8
1 0 1 1 0 0 0 1
Figure 6. The chromosome corresponding to the path given in Figure 2.
In the following subsections we give an explanation of different components (operations) of the
presented genetic algorithm.
4.1. Initial Population
The generated chromosome in initial population must contain at least two none zero elements to
be a real candidate path. The following steps show how to generate pop_size chromosomes of the
initial population:
1. Randomly generate a chromosome x.
2. Check if x represents a real candidate path, i.e. contains at least two non zero elements.
3. Repeat steps 1 to 2 to generate pop_size chromosomes.
4.2. The objective function
The cost of the candidate path is used as objective function to compare the solutions and find the
best one. The cost of the candidate path is calculated when it satisfies the following conditions:
The chromosome must contain at least two none zero elements.
The chromosome contains a connected candidate path. I.e. each node in the path connects
at least one another.
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
79
4.3. Genetic Crossover Operation
In the proposed GA, we use the single cut point crossover to breed a new offspring from two
parents. The crossover operation will be performed if the crossover ratio (Pc=0.90) is verified.
The cut point is randomly selected. Figure 7 shows the crossover operation.
Cut point
Parent 1 1 1 0 1 1 0 0
Child 1 1 1 0 1 1 0 1
Parent 1 0 1 0 0 1 0 1
Figure 7. Example of the crossover operation.
4.4. Genetic Mutation Operation
The mutation operation is performed on bit-by-bit basis. In the proposed approach, the mutation
operation will be performed if the mutation ratio (Pm) is verified. The Pm in this approach is
chosen experimentally to be 0.02. The point to be mutated is selected randomly. The offspring
generated by mutation is shown in Figure 8.
1 0 1 1 0 0 0 1
1 1 1 0 0 0 0 0
Figure 8. An example of the mutation operation.
5. THE ENTIRE ALGORITHM
The following pseudocode illustrates the use of our different components of the GA algorithm to
generate the minimum-cost paths tree of a given network.
Algorithm Find minimum-cost paths tree
Input : Set the parameters: pop_size, max_gen, Pm, Pc.
Output : Minimum-cost paths tree
1. Set j = 2, the destination node.
2. Generate the initial population according to the steps in Section 0.
3. gen←1.
4. While (gen < = max_gen) do {
5. P ← 1
6. While (P <= pop_size) do {
7. Apply Genetic operations to obtain new population
7.1. Apply crossover according to Pc parameter (Pc >=0.90) as described in section 4.3.
7.2. Apply Mutation as shown in section 4.4.
7.3. Compute the total cost of the candidate path according to Section 3.
8. P ← P+1.
9. }
10. Set gen =gen + 1
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
80
11. if gen > max_gen then stop
12. }
13. Save the candidate path for the destination j that has the minimum cost (the shortest path
between the root node and the destination node j).
14. Set j = j + 1
15. If j <= N Goto Step 2, otherwise stop the entire algorithm and print out the minimum-cost
paths tree.
5. EXPERIMENTAL RESULTS
The proposed algorithm is implemented using Borland C++ Ver. 5.5 and the initial values of the
parameters are: population size (pop-size=20), maximum generation (max_gen=50), Pc=0.90,
and Pm=0.02. The technique reads both the connection and cost matrices of the given network.
Then it generates the shortest paths tree of the network that posses the minimum cost. Two
Examples are used to test and validate the proposed technique.
5.1 Eight nodes example
In this section, we illustrate the results of applying the presented GA on an eight nodes
network example, as shown in Figure 9. The final output o the GA is shown in Table 1.
Figure 10 shows the shortest paths tree rooted at node 1.
Figure 9. Eight nodes network.
Table 1: The final output of the GA.
The chromosome The shortest paths set The cost
(1 1 0 0 0 0 0 0) {1, 2} 6
(1 0 1 0 0 0 0 0) {1, 3} 5
(1 0 1 1 0 0 0 0) {1, 3, 4} 9
(1 0 0 0 1 0 0 0) {1, 5} 4
(1 0 0 0 0 1 0 0) {1, 6} 6
(1 0 0 0 0 1 1 0) {1, 6, 7} 10
(1 0 1 1 0 0 0 1) {1, 3, 4, 8} 13
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
81
Figure 10: The shortest paths tree
6.2. Eleven nodes example
In this section, the GA is applied on eleven nodes example as shown in Figure 11. The final
output of the GA is shown in Table 2. Figure 12 shows the minimum-cost paths tree rooted at
node 1.
Figure 11: Eleven nodes network.
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
82
Table 2. The final output of the GA.
The chromosome The shortest paths set The cost
(1 1 0 0 0 0 0 0 0 0 0) {1, 2} 8
(1 0 1 0 0 0 0 0 0 0 1) {1, 11, 3} 8
(1 0 1 1 0 0 0 0 0 0 1) {1, 11, 3, 4} 17
(1 1 0 0 1 0 0 0 0 0 0) {1, 2, 5} 10
(1 0 0 0 0 1 1 0 0 0 0) {1, 7, 6} 17
(1 0 0 0 0 1 0 0 0 0 0) {1, 7} 9
(1 0 0 0 0 0 0 1 1 0 0) {1, 9, 8} 9
(1 0 0 0 0 0 0 0 1 0 0) {1, 9} 6
(1 0 0 0 0 0 0 0 0 1 1) {1, 11, 10} 11
(1 0 0 0 0 0 0 0 0 0 1) {1, 11} 3
Figure 12: The minimum-cost paths tree rooted at node 1.
6.3. Sixteen nodes example
Also, the GA is applied on sixteen nodes example as shown in Figure 13. The final output of the
GA is shown in Table 3. Figure 14 shows the minimum-cost paths tree rooted at node 1.
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
83
Figure 13: Sixteen nodes network
Table 3. The final output of the GA.
The chromosome The shortest paths set
The
cost
(1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0) {1, 3, 2} 11
(1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0) {1, 3} 3
(1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0) {1, 4} 7
(1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0) {1, 3, 2, 5} 14
(1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0) (1, 3, 7, 6} 21
(1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0) (1, 3, 7} 13
(1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0) (1, 3,7, 8} 30
(1 0 1 0 0 0 1 0 1 1 0 0 0 0 0 0 ) (1, 3, 7, 10, 9} 28
(1 1 1 0 1 0 0 0 0 1 0 0 0 0 0 0 ) (1, 3, 7, 10} 22
(1 0 0 1 0 0 1 1 0 0 1 0 0 0 0 0 ) (1, 3, 7, 11} 15
(1 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0) (1, 3, 7, 11, 12} 18
(1 0 1 0 0 0 1 0 0 0 1 1 1 0 0 ) (1, 3, 7, 11, 14, 13} 26
(1 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 ) (1, 3, 11, 12, 15, 14} 31
(1 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 ) (1, 3, 7, 11, 14, 15} 24
(1 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 ) (1, 3, 7, 11, 14, 16} 28
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
84
Figure 14: The minimum-cost paths tree rooted at node 1.
7. CONCLUSIONS
The paper addressed the minimum-cost paths tree problem and presented an efficient GA to solve
this problem. The algorithm reads both the connection and cost matrices of a given network, then
search the minimum-cost paths that construct the minimum-cost paths tree rooted at a given node
s. The GA has been applied on two examples, the results proved that the efficiency of the
proposed GA. For the future work, the GA can be extended to solve multi-constrained paths tree
problem.
References
[1] Pierre Hansen and Maolin Zheng, “Shortest shortest path trees of a network”, Discrete Applied
Mathematics, Vol. 65, Issues 1–3, March 1996, pp.275–284.
[2] Yueping Li, Zhe Nie and Xiaohong Zhou, “Finding the Optimal Shortest Path Tree with Respect to
Single Link Failure Recovery”, Fourth International Conference on Networked Computing and
Advanced Information Management, 2008, NCM '08, Vol. 1, pp. 412 – 415.
[3] Hiroshi Fujinoki and Kenneth J. Christensen, “The New Shortest Best Path Tree (SBPT) Algorithm
for Dynamic Multicast Trees”, Conference onLocal Computer Networks, 1999. LCN '99. pp. 201-
211.
[4] Athanasios K. Ziliaskopoulos, Fotios D. Mandanas, and Hani S. Mahmassani,”An extension of
labeling techniques for finding shortest path trees”, European Journal of Operational Research, Vol.
198 (2009), pp. 63–72.
[5] Hong Qua, Simon X. Yang, Zhang Yi, and Xiaobin Wanga, “A novel neural network method for
shortest path tree computation”, Applied Soft Computing, Vol. 12 (2012), pp. 3246–3259.
[6] Ting Lu and Jie Zhu, “A genetic algorithm for finding a path subject to two constraints”, Applied Soft
Computing, Vol. 13, Issue 2, February 2013, pp. 891-898.
[7] A. Younes , “A genetic algorithm for finding the k shortest paths in a network”, Egyptian Informatics
Journal, Vol. 11, Issue 2, December 2010, pp. 75-79.
[8 Linzhong Liu, Haibo Mu, Xinfeng Yang, Ruichun He, and Yinzhen LiAn, “oriented spanning tree
based genetic algorithm for multi-criteria shortest path problems”, Applied Soft Computing, Vol. 12,
Issue 1, January 2012, pp. 506-515.
[9] A. Younes, “Multicast routing with bandwidth and delay constraints based on genetic algorithms”,
Egyptian Informatics Journal, Vol. 12, Issue 2, July 2011, pp. 107-114.
International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015
85
AUTHORS
Ahmed Younes Hamed received his PhD degree in Sept. 1996 from South Valley
University, Egypt. His research interests include Artificial Intelligence and genetic
algorithms; specifically in the area of computer networks. Recently, he has started conducting
a research in the area of Image Processing. Currently, he works as an Associate Professor in
University of Dammam, KSA. Younes always publishes the outcome of his research in
international journals and conferences.
Moatamad Hassan holds a PhD of Computer Science in June 2006 from Aswan University,
Faculty of Science, Aswan, Egypt. He is currently an assistant professor at the Department of
Mathematics, Computer Science Branch, Faculty of Science, Aswan University, Aswan,
Egypt. His work deals with QoS, Reliability, and Computer Network Design problems.

More Related Content

PPTX
A general multiobjective clustering approach based on multiple distance measures
PDF
A NOVEL ANT COLONY ALGORITHM FOR MULTICAST ROUTING IN WIRELESS AD HOC NETWORKS
PDF
AROPUB-IJPGE-14-30
PDF
A Threshold Enhancement Technique for Chaotic On-Off Keying Scheme
PDF
Route Optimization to make Energy Efficient MANET using Vishal Fuzzy Genetic ...
PDF
Behavior study of entropy in a digital image through an iterative algorithm
PDF
Optimal buffer allocation in
PDF
On the performance of code word diversity based quasi orthogonal space time b...
A general multiobjective clustering approach based on multiple distance measures
A NOVEL ANT COLONY ALGORITHM FOR MULTICAST ROUTING IN WIRELESS AD HOC NETWORKS
AROPUB-IJPGE-14-30
A Threshold Enhancement Technique for Chaotic On-Off Keying Scheme
Route Optimization to make Energy Efficient MANET using Vishal Fuzzy Genetic ...
Behavior study of entropy in a digital image through an iterative algorithm
Optimal buffer allocation in
On the performance of code word diversity based quasi orthogonal space time b...

What's hot (20)

PDF
MULTI-OBJECTIVE ENERGY EFFICIENT OPTIMIZATION ALGORITHM FOR COVERAGE CONTROL ...
PDF
A C OMPARATIVE A NALYSIS A ND A PPLICATIONS O F M ULTI W AVELET T RANS...
PDF
Design of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree Multiplier
PDF
OPTIMIZED TASK ALLOCATION IN SENSOR NETWORKS
PDF
Compressive Sensing in Speech from LPC using Gradient Projection for Sparse R...
PDF
A Text-Independent Speaker Identification System based on The Zak Transform
PDF
PERFORMANCE AND COMPLEXITY ANALYSIS OF A REDUCED ITERATIONS LLL ALGORITHM
PDF
A detection technique of signal in mimo system
PDF
A detection technique of signal in mimo system
PDF
Neural Style Transfer in practice
PDF
Enriched Firefly Algorithm for Solving Reactive Power Problem
PDF
Improving Performance of Back propagation Learning Algorithm
PDF
A new efficient way based on special stabilizer multiplier permutations to at...
PDF
Bounds on the Achievable Rates of Faded Dirty Paper Channel
PDF
IRJET- Chord Classification of an Audio Signal using Artificial Neural Network
PDF
Architecture neural network deep optimizing based on self organizing feature ...
PDF
CFM Challenge - Course Project
PDF
P REDICTION F OR S HORT -T ERM T RAFFIC F LOW B ASED O N O PTIMIZED W...
PDF
Macromodel of High Speed Interconnect using Vector Fitting Algorithm
PDF
PAPR analysis of OFDM system using AI based multiple signal representation me...
MULTI-OBJECTIVE ENERGY EFFICIENT OPTIMIZATION ALGORITHM FOR COVERAGE CONTROL ...
A C OMPARATIVE A NALYSIS A ND A PPLICATIONS O F M ULTI W AVELET T RANS...
Design of an Adaptive Hearing Aid Algorithm using Booth-Wallace Tree Multiplier
OPTIMIZED TASK ALLOCATION IN SENSOR NETWORKS
Compressive Sensing in Speech from LPC using Gradient Projection for Sparse R...
A Text-Independent Speaker Identification System based on The Zak Transform
PERFORMANCE AND COMPLEXITY ANALYSIS OF A REDUCED ITERATIONS LLL ALGORITHM
A detection technique of signal in mimo system
A detection technique of signal in mimo system
Neural Style Transfer in practice
Enriched Firefly Algorithm for Solving Reactive Power Problem
Improving Performance of Back propagation Learning Algorithm
A new efficient way based on special stabilizer multiplier permutations to at...
Bounds on the Achievable Rates of Faded Dirty Paper Channel
IRJET- Chord Classification of an Audio Signal using Artificial Neural Network
Architecture neural network deep optimizing based on self organizing feature ...
CFM Challenge - Course Project
P REDICTION F OR S HORT -T ERM T RAFFIC F LOW B ASED O N O PTIMIZED W...
Macromodel of High Speed Interconnect using Vector Fitting Algorithm
PAPR analysis of OFDM system using AI based multiple signal representation me...
Ad

Viewers also liked (10)

PDF
IMPROVED QUALITY OF SERVICE PROTOCOL FOR REAL TIME TRAFFIC IN MANET
PDF
A distributed ip based telecommunication system using sip
PDF
DESIGNING SECURE CLUSTERING PROTOCOL WITH THE APPROACH OF REDUCING ENERGY CON...
PDF
An Optimal Software Framework for Parallel Computation of CRC
PDF
IDS IN TELECOMMUNICATION NETWORK USING PCA
PDF
Minimizing mobiles communication time using modified binary exponential backo...
PDF
Novel designs of broadband patch
PDF
EFFECT OF OPERATING WAVELENGTHS AND DIFFERENT WEATHER CONDITIONS ON PERFORMAN...
PDF
AN EFFICIENT ANT BASED QOS AWARE INTELLIGENT TEMPORALLY ORDERED ROUTING ALGOR...
PDF
IMPROVING IPV6 ADDRESSING TYPES AND SIZE
IMPROVED QUALITY OF SERVICE PROTOCOL FOR REAL TIME TRAFFIC IN MANET
A distributed ip based telecommunication system using sip
DESIGNING SECURE CLUSTERING PROTOCOL WITH THE APPROACH OF REDUCING ENERGY CON...
An Optimal Software Framework for Parallel Computation of CRC
IDS IN TELECOMMUNICATION NETWORK USING PCA
Minimizing mobiles communication time using modified binary exponential backo...
Novel designs of broadband patch
EFFECT OF OPERATING WAVELENGTHS AND DIFFERENT WEATHER CONDITIONS ON PERFORMAN...
AN EFFICIENT ANT BASED QOS AWARE INTELLIGENT TEMPORALLY ORDERED ROUTING ALGOR...
IMPROVING IPV6 ADDRESSING TYPES AND SIZE
Ad

Similar to A genetic algorithm to solve the (20)

PDF
An Ant Algorithm for Solving QoS Multicast Routing Problem
PDF
A Genetic Algorithm for Reliability Evaluation of a Stochastic-Flow Network w...
PDF
Energy-Aware Multipath Routing Scheme Based on Particle Swarm Optimization (E...
PDF
A genetic algorithm for constructing broadcast trees with cost and delay cons...
PDF
Using Genetic Algorithm for Shortest Path Selection with Real Time Traffic Flow
PDF
SOLVING OPTIMAL COMPONENTS ASSIGNMENT PROBLEM FOR A MULTISTATE NETWORK USING ...
PDF
SOLVING OPTIMAL COMPONENTS ASSIGNMENT PROBLEM FOR A MULTISTATE NETWORK USING ...
PDF
Improving The Performance of Viterbi Decoder using Window System
PDF
50120130406039
PDF
PDF
Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...
PDF
Investigation on the Pattern Synthesis of Subarray Weights for Low EMI Applic...
PDF
An Algorithm for Computing Average Packet Delay
PPT
Network coding
PDF
Routing in Wireless Mesh Networks: Two Soft Computing Based Approaches
PDF
Neuro genetic key based recursive modulo 2 substitution using mutated charact...
PDF
A Biologically Inspired Network Design Model
PDF
A Biologically Inspired Network Design Model
PDF
Performance Analysis of Mtpr Routing Protocol in Power Deficient Node
PDF
E021052327
An Ant Algorithm for Solving QoS Multicast Routing Problem
A Genetic Algorithm for Reliability Evaluation of a Stochastic-Flow Network w...
Energy-Aware Multipath Routing Scheme Based on Particle Swarm Optimization (E...
A genetic algorithm for constructing broadcast trees with cost and delay cons...
Using Genetic Algorithm for Shortest Path Selection with Real Time Traffic Flow
SOLVING OPTIMAL COMPONENTS ASSIGNMENT PROBLEM FOR A MULTISTATE NETWORK USING ...
SOLVING OPTIMAL COMPONENTS ASSIGNMENT PROBLEM FOR A MULTISTATE NETWORK USING ...
Improving The Performance of Viterbi Decoder using Window System
50120130406039
Design and Performance Analysis of Convolutional Encoder and Viterbi Decoder ...
Investigation on the Pattern Synthesis of Subarray Weights for Low EMI Applic...
An Algorithm for Computing Average Packet Delay
Network coding
Routing in Wireless Mesh Networks: Two Soft Computing Based Approaches
Neuro genetic key based recursive modulo 2 substitution using mutated charact...
A Biologically Inspired Network Design Model
A Biologically Inspired Network Design Model
Performance Analysis of Mtpr Routing Protocol in Power Deficient Node
E021052327

More from IJCNCJournal (20)

PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
Authenticated Key Agreement Protocol with Forward Secrecy for Securing Cyber ...
PDF
Enhancing IoT Cyberattack Detection via Hyperparameter Optimization Technique...
PDF
Analysis of LTE/5G Network Performance Parameters in Smartphone Use Cases: A ...
PDF
An Energy Hole Detection and Relay Repositioning in Cluster Based Routing Pro...
PDF
Performance of Multi-Hop FSO Systems Under Practical Conditions with Malaga T...
PDF
QoS Based Reliable Route in MANET for Military Applications
PDF
Conflict Flow Avoided Proactive Rerouting Algorithm using Online Active Learn...
PDF
A Cluster-Based Trusted Secure Multipath Routing Protocol for Mobile Ad Hoc N...
PDF
Evaluating OTFS Modulation for 6G: Impact of High Mobility and Environmental ...
PDF
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
PDF
Classification of Network Traffic using Machine Learning Models on the NetML ...
PDF
A Cluster-Based Trusted Secure Multipath Routing Protocol for Mobile Ad Hoc N...
PDF
Energy Efficient Virtual MIMO Communication Designed for Cluster based on Coo...
PDF
An Optimized Energy-Efficient Hello Routing Protocol for Underwater Wireless ...
PDF
Evaluating OTFS Modulation for 6G: Impact of High Mobility and Environmental ...
PDF
Simulated Annealing-Salp Swarm Algorithm based Variational Autoencoder for Pe...
PDF
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
PDF
Developing a Secure and Transparent Blockchain System for Fintech with Fintru...
PDF
Visually Image Encryption and Compression using a CNN-Based Autoencoder
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Authenticated Key Agreement Protocol with Forward Secrecy for Securing Cyber ...
Enhancing IoT Cyberattack Detection via Hyperparameter Optimization Technique...
Analysis of LTE/5G Network Performance Parameters in Smartphone Use Cases: A ...
An Energy Hole Detection and Relay Repositioning in Cluster Based Routing Pro...
Performance of Multi-Hop FSO Systems Under Practical Conditions with Malaga T...
QoS Based Reliable Route in MANET for Military Applications
Conflict Flow Avoided Proactive Rerouting Algorithm using Online Active Learn...
A Cluster-Based Trusted Secure Multipath Routing Protocol for Mobile Ad Hoc N...
Evaluating OTFS Modulation for 6G: Impact of High Mobility and Environmental ...
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
Classification of Network Traffic using Machine Learning Models on the NetML ...
A Cluster-Based Trusted Secure Multipath Routing Protocol for Mobile Ad Hoc N...
Energy Efficient Virtual MIMO Communication Designed for Cluster based on Coo...
An Optimized Energy-Efficient Hello Routing Protocol for Underwater Wireless ...
Evaluating OTFS Modulation for 6G: Impact of High Mobility and Environmental ...
Simulated Annealing-Salp Swarm Algorithm based Variational Autoencoder for Pe...
A Framework for Securing Personal Data Shared by Users on the Digital Platforms
Developing a Secure and Transparent Blockchain System for Fintech with Fintru...
Visually Image Encryption and Compression using a CNN-Based Autoencoder

Recently uploaded (20)

PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
DOCX
573137875-Attendance-Management-System-original
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
UNIT 4 Total Quality Management .pptx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPTX
Fundamentals of Mechanical Engineering.pptx
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Internet of Things (IOT) - A guide to understanding
PPT
introduction to datamining and warehousing
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Safety Seminar civil to be ensured for safe working.
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
573137875-Attendance-Management-System-original
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
UNIT 4 Total Quality Management .pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
Fundamentals of Mechanical Engineering.pptx
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Embodied AI: Ushering in the Next Era of Intelligent Systems
Internet of Things (IOT) - A guide to understanding
introduction to datamining and warehousing
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Safety Seminar civil to be ensured for safe working.

A genetic algorithm to solve the

  • 1. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 DOI : 10.5121/ijcnc.2015.7405 75 A GENETIC ALGORITHM TO SOLVE THE MINIMUM-COST PATHS TREE PROBLEM Ahmed Y. Hamed1 and M. R. Hassan2 1 College of Applied Studies and Community Services, University of Dammam, KSA. 2 Computer Science Branch, Mathematics Department, Faculty of Science, Aswan University, Egypt. ABSTRACT One of the important steps in routing is to find a feasible path based on the state information. In order to support real-time multimedia applications, the feasible path that satisfies one or more constraints has to be computed within a very short time. Therefore, the paper presents a genetic algorithm to solve the paths tree problem subject to cost constraints. The objective of the algorithm is to find the set of edges connecting all nodes such that the sum of the edge costs from the source (root) to each node is minimized. I.e. the path from the root to each node must be a minimum cost path connecting them. The algorithm has been applied on two sample networks, the first network with eight nodes, and the last one with eleven nodes to illustrate its efficiency. KEYWORDS Computer networks; Minimum-cost paths tree; Genetic algorithms. 1. INTRODUCTION The shortest paths tree rooted at vertex s is a spanning tree T of G, such that the path distance from root v to any other vertex u in T is the shortest path distance from v to u in G,[1]. In the case of single link failure, [2], proposed an algorithm to solve the optimal shortest paths tree. When considering multicast tree, [3], the authors presented an algorithm to find the Shortest Best Path Tree (SBPT). Based on labeling techniques, Ziliaskopoulos et al. in [4], proposed an algorithm to solve the shortest path trees. Also, The shortest paths tree problem has been solved by an efficient modified continued pulse coupled neural network (MCPCNN) model, [5]. Heuristic and approximate algorithms for multi-constrained routing (MCR) are not effective in dynamic network environment for real-time applications when the state information of the network is out of date, [6]. The authors in [6] presented a genetic algorithm to solve the MCR problem subject to transmission delay and transmission success ratio. Younes in [7] proposed a genetic algorithm to determine the k shortest paths with bandwidth constraints from a single source node to multiple destinations nodes. Liu et al. in [8] presented an oriented spanning tree (OST) based genetic algorithm (GA) for solving both the multi-criteria shortest path problem (MSPP) and the multi-criteria constrained shortest path problems (MCSPP). Also, in [9] the genetic algorithm is used to find the low-cost multicasting tree with bandwidth and delay constraints. The paper presents a genetic algorithm to solve the paths tree problem under cost constraint. The algorithm reads the connection matrix and the cost matrix of a given network. Also, given the source (root) node s, then the genetic operations are executed to search the minimum cost paths that construct the minimum cost paths tree rooted at the source node s.
  • 2. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 76 The rest of the paper is organized as follows: Section 2 presents notations. The problem description in section 3. The proposed GA and its components are given in section 4. Section 5 provides the pseudo code of the entire GA. Section 6 shows the illustrative examples. Finally, section 7 presents conclusions. 2. Notations G N E eij ce M CM np Ts A network graph. The number of nodes in G. The number of edges in G. An edge between node i and node j in G. The cost of an edge e. The connection matrix of the given network. The cost matrix of the given network. The number of paths from node s to t The shortest path rooted at node s 3. THE PROBLEM DESCRIPTION Given a specified vertex s. Let Pi (s, t) be a path number i from s to t. Let Ci (P(s, t)) be the cost of the path Pi (s, t), i = 1,2, …, np. The path Pk (s, t) has a minimum cost among all the (s, t)-paths if: Where Therefore, the minimum-cost paths tree Ts is the collection of minimum cost paths from the source (root) node s to the destination nodes ti. I.e. The presented method in this paper depend on reading both the connection and cost matrices of a given network, and then find the minimum-cost paths tree rooted at the source node. Consider the following network with five nodes, shown in Figure 1.
  • 3. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 77 Figure 1. Five nodes network. The connection matrix (a square matrix of dimension N x N that represents a connection between each node-pairs) of the Figure 1 network is: Figure 2. The connection matrix of network in Figure 1 The cost matrix CM for the network shown in Figure 1 is in the following form: Figure 3. The cost matrix network in Figure 1. In Figure 4, we show that the minimum-cost paths tree rooted at node 1 with the minimum cost equals to 23. Figure 4. Minimum-cost paths tree rooted at node 1
  • 4. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 78 4. THE PROPOSED GENETIC ALGORITHM (GA) In the proposed GA, each candidate path is represented by a binary string with length N that can be used as a chromosome. Each element of the chromosome represents a node in the network topology. So, for a network of N nodes, there are N string components in each candidate solution x. Each chromosome must contain at least two none zero elements. For example if N = 8, the path of Figure 5 is represented as a chromosome as shown in Figure 6. Figure Figure 5. A candidate Path. 1 2 3 4 5 6 7 8 1 0 1 1 0 0 0 1 Figure 6. The chromosome corresponding to the path given in Figure 2. In the following subsections we give an explanation of different components (operations) of the presented genetic algorithm. 4.1. Initial Population The generated chromosome in initial population must contain at least two none zero elements to be a real candidate path. The following steps show how to generate pop_size chromosomes of the initial population: 1. Randomly generate a chromosome x. 2. Check if x represents a real candidate path, i.e. contains at least two non zero elements. 3. Repeat steps 1 to 2 to generate pop_size chromosomes. 4.2. The objective function The cost of the candidate path is used as objective function to compare the solutions and find the best one. The cost of the candidate path is calculated when it satisfies the following conditions: The chromosome must contain at least two none zero elements. The chromosome contains a connected candidate path. I.e. each node in the path connects at least one another.
  • 5. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 79 4.3. Genetic Crossover Operation In the proposed GA, we use the single cut point crossover to breed a new offspring from two parents. The crossover operation will be performed if the crossover ratio (Pc=0.90) is verified. The cut point is randomly selected. Figure 7 shows the crossover operation. Cut point Parent 1 1 1 0 1 1 0 0 Child 1 1 1 0 1 1 0 1 Parent 1 0 1 0 0 1 0 1 Figure 7. Example of the crossover operation. 4.4. Genetic Mutation Operation The mutation operation is performed on bit-by-bit basis. In the proposed approach, the mutation operation will be performed if the mutation ratio (Pm) is verified. The Pm in this approach is chosen experimentally to be 0.02. The point to be mutated is selected randomly. The offspring generated by mutation is shown in Figure 8. 1 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 Figure 8. An example of the mutation operation. 5. THE ENTIRE ALGORITHM The following pseudocode illustrates the use of our different components of the GA algorithm to generate the minimum-cost paths tree of a given network. Algorithm Find minimum-cost paths tree Input : Set the parameters: pop_size, max_gen, Pm, Pc. Output : Minimum-cost paths tree 1. Set j = 2, the destination node. 2. Generate the initial population according to the steps in Section 0. 3. gen←1. 4. While (gen < = max_gen) do { 5. P ← 1 6. While (P <= pop_size) do { 7. Apply Genetic operations to obtain new population 7.1. Apply crossover according to Pc parameter (Pc >=0.90) as described in section 4.3. 7.2. Apply Mutation as shown in section 4.4. 7.3. Compute the total cost of the candidate path according to Section 3. 8. P ← P+1. 9. } 10. Set gen =gen + 1
  • 6. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 80 11. if gen > max_gen then stop 12. } 13. Save the candidate path for the destination j that has the minimum cost (the shortest path between the root node and the destination node j). 14. Set j = j + 1 15. If j <= N Goto Step 2, otherwise stop the entire algorithm and print out the minimum-cost paths tree. 5. EXPERIMENTAL RESULTS The proposed algorithm is implemented using Borland C++ Ver. 5.5 and the initial values of the parameters are: population size (pop-size=20), maximum generation (max_gen=50), Pc=0.90, and Pm=0.02. The technique reads both the connection and cost matrices of the given network. Then it generates the shortest paths tree of the network that posses the minimum cost. Two Examples are used to test and validate the proposed technique. 5.1 Eight nodes example In this section, we illustrate the results of applying the presented GA on an eight nodes network example, as shown in Figure 9. The final output o the GA is shown in Table 1. Figure 10 shows the shortest paths tree rooted at node 1. Figure 9. Eight nodes network. Table 1: The final output of the GA. The chromosome The shortest paths set The cost (1 1 0 0 0 0 0 0) {1, 2} 6 (1 0 1 0 0 0 0 0) {1, 3} 5 (1 0 1 1 0 0 0 0) {1, 3, 4} 9 (1 0 0 0 1 0 0 0) {1, 5} 4 (1 0 0 0 0 1 0 0) {1, 6} 6 (1 0 0 0 0 1 1 0) {1, 6, 7} 10 (1 0 1 1 0 0 0 1) {1, 3, 4, 8} 13
  • 7. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 81 Figure 10: The shortest paths tree 6.2. Eleven nodes example In this section, the GA is applied on eleven nodes example as shown in Figure 11. The final output of the GA is shown in Table 2. Figure 12 shows the minimum-cost paths tree rooted at node 1. Figure 11: Eleven nodes network.
  • 8. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 82 Table 2. The final output of the GA. The chromosome The shortest paths set The cost (1 1 0 0 0 0 0 0 0 0 0) {1, 2} 8 (1 0 1 0 0 0 0 0 0 0 1) {1, 11, 3} 8 (1 0 1 1 0 0 0 0 0 0 1) {1, 11, 3, 4} 17 (1 1 0 0 1 0 0 0 0 0 0) {1, 2, 5} 10 (1 0 0 0 0 1 1 0 0 0 0) {1, 7, 6} 17 (1 0 0 0 0 1 0 0 0 0 0) {1, 7} 9 (1 0 0 0 0 0 0 1 1 0 0) {1, 9, 8} 9 (1 0 0 0 0 0 0 0 1 0 0) {1, 9} 6 (1 0 0 0 0 0 0 0 0 1 1) {1, 11, 10} 11 (1 0 0 0 0 0 0 0 0 0 1) {1, 11} 3 Figure 12: The minimum-cost paths tree rooted at node 1. 6.3. Sixteen nodes example Also, the GA is applied on sixteen nodes example as shown in Figure 13. The final output of the GA is shown in Table 3. Figure 14 shows the minimum-cost paths tree rooted at node 1.
  • 9. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 83 Figure 13: Sixteen nodes network Table 3. The final output of the GA. The chromosome The shortest paths set The cost (1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0) {1, 3, 2} 11 (1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0) {1, 3} 3 (1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0) {1, 4} 7 (1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0) {1, 3, 2, 5} 14 (1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0) (1, 3, 7, 6} 21 (1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0) (1, 3, 7} 13 (1 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0) (1, 3,7, 8} 30 (1 0 1 0 0 0 1 0 1 1 0 0 0 0 0 0 ) (1, 3, 7, 10, 9} 28 (1 1 1 0 1 0 0 0 0 1 0 0 0 0 0 0 ) (1, 3, 7, 10} 22 (1 0 0 1 0 0 1 1 0 0 1 0 0 0 0 0 ) (1, 3, 7, 11} 15 (1 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0) (1, 3, 7, 11, 12} 18 (1 0 1 0 0 0 1 0 0 0 1 1 1 0 0 ) (1, 3, 7, 11, 14, 13} 26 (1 0 1 0 0 0 0 0 0 0 1 1 0 1 1 0 ) (1, 3, 11, 12, 15, 14} 31 (1 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 ) (1, 3, 7, 11, 14, 15} 24 (1 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 ) (1, 3, 7, 11, 14, 16} 28
  • 10. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 84 Figure 14: The minimum-cost paths tree rooted at node 1. 7. CONCLUSIONS The paper addressed the minimum-cost paths tree problem and presented an efficient GA to solve this problem. The algorithm reads both the connection and cost matrices of a given network, then search the minimum-cost paths that construct the minimum-cost paths tree rooted at a given node s. The GA has been applied on two examples, the results proved that the efficiency of the proposed GA. For the future work, the GA can be extended to solve multi-constrained paths tree problem. References [1] Pierre Hansen and Maolin Zheng, “Shortest shortest path trees of a network”, Discrete Applied Mathematics, Vol. 65, Issues 1–3, March 1996, pp.275–284. [2] Yueping Li, Zhe Nie and Xiaohong Zhou, “Finding the Optimal Shortest Path Tree with Respect to Single Link Failure Recovery”, Fourth International Conference on Networked Computing and Advanced Information Management, 2008, NCM '08, Vol. 1, pp. 412 – 415. [3] Hiroshi Fujinoki and Kenneth J. Christensen, “The New Shortest Best Path Tree (SBPT) Algorithm for Dynamic Multicast Trees”, Conference onLocal Computer Networks, 1999. LCN '99. pp. 201- 211. [4] Athanasios K. Ziliaskopoulos, Fotios D. Mandanas, and Hani S. Mahmassani,”An extension of labeling techniques for finding shortest path trees”, European Journal of Operational Research, Vol. 198 (2009), pp. 63–72. [5] Hong Qua, Simon X. Yang, Zhang Yi, and Xiaobin Wanga, “A novel neural network method for shortest path tree computation”, Applied Soft Computing, Vol. 12 (2012), pp. 3246–3259. [6] Ting Lu and Jie Zhu, “A genetic algorithm for finding a path subject to two constraints”, Applied Soft Computing, Vol. 13, Issue 2, February 2013, pp. 891-898. [7] A. Younes , “A genetic algorithm for finding the k shortest paths in a network”, Egyptian Informatics Journal, Vol. 11, Issue 2, December 2010, pp. 75-79. [8 Linzhong Liu, Haibo Mu, Xinfeng Yang, Ruichun He, and Yinzhen LiAn, “oriented spanning tree based genetic algorithm for multi-criteria shortest path problems”, Applied Soft Computing, Vol. 12, Issue 1, January 2012, pp. 506-515. [9] A. Younes, “Multicast routing with bandwidth and delay constraints based on genetic algorithms”, Egyptian Informatics Journal, Vol. 12, Issue 2, July 2011, pp. 107-114.
  • 11. International Journal of Computer Networks & Communications (IJCNC) Vol.7, No.4, July 2015 85 AUTHORS Ahmed Younes Hamed received his PhD degree in Sept. 1996 from South Valley University, Egypt. His research interests include Artificial Intelligence and genetic algorithms; specifically in the area of computer networks. Recently, he has started conducting a research in the area of Image Processing. Currently, he works as an Associate Professor in University of Dammam, KSA. Younes always publishes the outcome of his research in international journals and conferences. Moatamad Hassan holds a PhD of Computer Science in June 2006 from Aswan University, Faculty of Science, Aswan, Egypt. He is currently an assistant professor at the Department of Mathematics, Computer Science Branch, Faculty of Science, Aswan University, Aswan, Egypt. His work deals with QoS, Reliability, and Computer Network Design problems.