In this thesis, we present efficient sequential and parallel algorithms for solving the generalized vertex coloring (/-vertex-coloring) problem and the generalized edge coloring (/-edge coloring) problem on trees. We then present a simple strategy to transform the I-edge coloring problem into an I~vertex coloring problem and develop both a sequential and a parallel algorithm to solve the I-edge coloring problem on trees. In section 1.2 we give a generalization of the common vertex coloring problem and provide the necessary motivation for generalization.
Vertex-coloring Problem
A graph can be constructed where there is a variable associated with each vertex and an edge between any two vertices indicates that the variable lifetimes intersect. A color of the vertices of this graph assigns the variables to classes so that two variables with the same color do not collide and can therefore be assigned to the same register. This requires determining whether the regions of each map can be colored using at most four colors so that no two neighboring regions have the same color.
Edge-coloring Problem
If the vertices of a graph G represent a set of university courses with edges between courses with regular students, then the chromatic number is the minimum number of periods needed to schedule exams without conflicts. The edge coloring of graphs arises in a variety of scheduling applications, typically associated with minimizing the number of non-perturbative rounds required to complete a given set of tasks. The color classes represent the different time periods in the schedule where all meetings of the same color take place simultaneously.
Generalized Vertex-Coloring
For example, consider a situation where we need to schedule a set of interviews with two people, each interview lasting one hour. All meetings can be scheduled to occur at different times to avoid conflicts, but it is less wasteful to schedule non-conflicting events simultaneously. We can construct a graph whose vertices are people and whose edges represent pairs of people who want to meet.
1.2.1 [-vertex-coloring
Generalized Edge-Coloring
- l-edge-coloring
General edge coloring or edge coloring of a graph G is an assignment of colors to the edges of G such that any two edges ej and ez in G are given different colors if dist(eI, ez) S; I, where dist(eI, ez) is the length of the shortest path between the nearest endpoints of the andezine G. The minimum number of colors with which we can obtain an l-edge coloring of a graph G is called the l edge. -chromatic number of G. For example, the problematic scheduling of football matches can be extended so that the return matches are scheduled with a reasonable time interval between them.
Summary
Classes of Graphs Time Complexity Reference
Classes of
Problem Algorithm Complexity Graphs
Preliminaries
- Basic Terminology
- Graphs and Multigraphs
- Degree of a vertex
- Subgraphs
- Weighted Graphs
- Paths and Distances
- Trees
- PRAM Models
- Tree Contraction Algorithm
- SetA :=A odd
- Equivalent Binary Tree of a Tree
The degree of a vertex v in a graph G is the number of edges incident on v and is denoted by dG(v) or simply by dey). A graph where each of the edges has a positive weight is called a weighted graph. Now if 1+ is the set of all positive integers, then we can define the weight function for the edges as w:E ~ t.
In a weighted graph, the length of a path is determined by the weight of the edges that make up the path. A rooted tree is a free tree where one of the nodes is separated from others. The node Ujis is called an ancestor of Utand node Utis is called a descendant of Uj. The root is the ancestor of every node in a tree, and every node is a descendant of the root.
The height of a node U in a tree is the length of the longest path from ut to a leaf. The depth of a node in the tree is the length of a path from the root to u. A standard name for the synchronous shared memory model is the parallel random access machine (PRAM) model.
We now show how an arbitrary rooted tree rooted at s can be reduced to a regular binary tree Tb, which is the canonical binary representation of the tree T .
Sequential Algorithm for 1- Vertex-Coloring of Trees
Preliminaries
For the sake of convenience, an arbitrary vertex of the tree T. is designated as the root of T. We will use notions such as: root, inner vertex, child and leaf in their usual meaning. If, N is the set of all positive integers, then we can define the weight function for edges as w: E ~ N. The distance from one vertex u to another vertex v, denoted by dist( u, v), is the length of the path P from u to v to T .
Let, the number of colors used by a vertex coloring If! of the Tis tree is marked with #If!. The distance vector of a vertex U E V, denoted as D(If!, u) or simply D(u), is defined as an m-tuple. Consider partial coloring where some of the nodes are already assigned colors while nodes G, band c are not yet colored.
If we consider the distance vectors in the domain of the (I+ 2) base system, we get such an enumeration. Example: The distance vectors in 4-vertex coloring shown in Figure 3.1 can be considered in the domain of the 6 (= 4+2) base system. We can calculate these combination results in advance and store them in a (I + 2)m x (I + 2)m two-dimensional matrix eM. Any invalid combination result can be represented by a special value that is not in the range (0.
Combination of two distance vectors can be done in O(I)time
- An Efficient Algorithm
In the worst case, at most (I +2)"' distance vectors are generated for a given node. The remainder of this section gives an algorithm to solve the I-vertex coloring problem on trees in time O(logax (I + 2)2a Xn), where a = d+l -1. First we will present an algorithm I_vertex_color that finds an I-vertex coloring of Tb with a given set of colors [I,.
If the list of distance vectors at root node contains no distance vector, it is not possible to obtain an I-vertex coloring of Th with m colors. Otherwise, each existing distance vector at root represents a different I-vertex color of the given tree using m colors. A node v in the binary decomposition tree Tb, a coloring set [1, .. ,m) Output: All possible I-vertex coloring of subtree rooted at v with m colors. if v is not a leaf node, then 2. Create a new list of distance vectors Dv containing no vector, for this leaf node 7.
A node v in the binary decomposition tree Tb, a set of colors [I, .. ,m) Result: Updated Jist bitmap of node v's distance vectors. We now present the optimal vertex coloring algorithm I~~ ~ (Algorithm 3.4) that uses I~vertex Joloring to solve the optimal vertex coloring I in the tree. I_vertex _coloring simply performs a traversal of the order of the input tree and calls Junction node and edge Junction for each internal node.
However, if the node being processed is a leaf node, I_vertex_coloring constructs the initial list of distance vectors instead of calling nodeJunction.
I + 2)POS-1 '
Conclusion
In this chapter, we used a sequential algorithm to solve the I-vertex coloring problem on trees. This is the first known direct solution to I-vertex coloring problem on regular trees that guarantees an optimal solution.
Parallel Algorithm for 1- Vertex-Coloring of Trees
Preliminaries
In addition, we also need to carefully assign the operations to different processors so that they can be executed in parallel. Each combination is assigned a different processor, so the number of processors needed and the number of operations will be 0((1 +2)2m). Each processor will read a unique element of the CM matrix, but multiple processors can write to the same location in the resulting distance vector list.
However, since the number of processors that can write to a given location is bounded (for bounded 1 and m), we can use the EREW PRAM model.
An Efficient Parallel Algorithm
For all integers i, I :s;i:S;m, initialize the list of distance vectors of each leaf so that the list contains all distance vectors of the form-. Initialize the list of distance vectors from each internal vertex to be an empty list;. Initially, the list in each leaf node contains all distance vectors representing a single color assignment.
For this problem, both NF and EF have a single element: the node function and the edge function, described in Algorithms 4.1 and 4.2, respectively. For ease of description, we will use the notations Fnode(v) and Fedge(e) for the node function and the edge function, respectively. The shunt operation defined in section 2.4 changes the edge function corresponding to the edge eo.
We will use a modified version of the shunt operation where we change the parameters of the node function associated with node V2. Ifv2 is a leaf node, then x will be the list of distance vectors from node V2 and the second parameter x' can also be calculated in 0(1) time. However, ifv2 is not a leaf node, evaluation of the second parameter x' and thus the node function itself must be deferred until the value of x' is available.
In this case, the shunt operation simply updates the parameters previously associated with V2, and this operation takes 0(1) time.
- Conclusion
The number of processors required at this stage is 0((1+2?rn x nJ Line 7 can be executed in 0(1) time and O(n) operations using O(n) processors on the EREW PRAM model. The last stage follows from the observation that each node function is visited at most twice - first to change the parameter and then to evaluate it finally In this chapter we have presented a parallel algorithm for solving the I-vertex coloring problem on trees.
Our algorithm solves the I-vertex coloring problem on trees in O(log2 n) .time using O(ax(I +2 )2a Xn) operations on the EREW PRAM model, where n is the number of vertices in Tand is upper bound for the number of colors. Ours is the first known parallel algorithm to solve the l-vertex coloring problem on trees.
Optimall-Edge-Coloring of Trees
- Transforming l-edge-coloring problem into l-vertex- coloring problem
- A sequential algorithm for optimall-edge-coloring oftrees
- A parallel algorithm for optimall-edge-coloring of trees
- Finding the Color Assignment
- Conclusion
- Conclusion
In this section, we give an efficient sequential algorithm for solving the I-edge coloring problem on trees. Output: All possible l-edge colorings of the subtree rooted in v with mcolors (if any). In this section, we will give an efficient parallel algorithm for solving the I-edge coloring problem.
In this chapter we have presented a sequential and parallel algorithm to solve the problem of edge coloring in trees. Our sequential algorithm finds the optimal l edge coloring of a tree in O(log x(I'I-2)2a Xn) time while the parallel algorithm finds the l optimal edge coloring of a tree in 0(log2 n) time using processors O(ax(I +2ya xn) Both of these algorithms are the first known algorithms that solve the problem of coloring edges l in trees.
This thesis addresses a generalized vertex coloring problem and a generalized edge coloring problem on trees. First, we described a technique to transform the l-edge coloring problem into the l-vertex coloring problem on trees. We then identified the changes to our previous algorithm necessary to solve the l-edge coloring problem.
Finally, we have described a sequential and a parallel algorithm to solve the l-edge coloring problem on trees.
Index