Application of Edge Coloring of a Fuzzy Graph

International Journal of Computer Applications (0975 – 8887)
Volume 6– No.2, September 2010
Application of Edge Coloring of a Fuzzy Graph
Poornima B.
Dr. V. Ramaswamy
Research Scholar
B.I.E.T., Davangere.
Karnataka, India.
Professor and Head
I.S. & E Department, B.I.E.T. Davangere.
Karnataka, India.
ABSTRACT
2. COURSE TIME TABLING PROBLEM
In this paper, we have developed an algorithm to generate a
course Time table satisfying certain constraints using Edge
coloring of a fuzzy graph. With examples, we show how these
constraints are satisfied.
In general time tabling problem, we assume there are m teachers
T1, T2…Tm who teach for n semesters S1, S2, …..Sn. Each teacher
Ti teaches a subject for semester Sj for pi j periods in a week. This
problem can be represented using a fuzzy bi partite graph and
the required time table can be generated using edge coloring of a
fuzzy graph. Edge coloring is applied at two different stages. In
the first stage, days are allocated for each teacher for each
semester the teacher will be teaching. In the second stage, for the
days allotted in the first stage, time slots will be allocated.
General Terms
Fuzzy Logic, Fuzzy Graph.
Keywords
Edge coloring of a Fuzzy Graph, Time table problem.
1. INTRODUCTION
Edge coloring of graph arises in a variety of scheduling
applications. One such application [1] is Time table scheduling
problem. In Time tabling problem, it is required to schedule all
the courses in such a way that no two classes of the same course
are scheduled at the same time. If each edge color [2] represents a
time slot in the schedule, then an edge coloring of a graph
represents a feasible time table for courses.
Time tabling problem involves factors such as teachers, classes
and courses. Various resources are rooms, time slots etc. Time
tabling problem [3] is concerned with maximum utilization of the
available resources subject to a set of constraints and can be
classified [4] into three main classes namely school time tabling,
course time tabling and examination time tabling. In this paper,
we have attempted to give solution to course time tabling problem
using the concept of Edge coloring of a fuzzy graph.
Using the definition of edge coloring of a fuzzy graph and
algorithm developed in our paper [5], we have attempted to
generate course Time table satisfying the following constraints.
Nevertheless, the solutions we propose can be applied to general
time tabling problem.
1. We assume that the number of semesters is three.
2. Six subjects are to be taught by different teachers for each
semester.
3. Every teacher will be handling two subjects (of course, for
different semesters).
4. Each subject should be taught for four hours in a week.
5. Classes are held for seven hours from Monday to Friday and for
four hours on Saturdays.
We note that the department requires totally nine teachers for
teaching all the subjects and the department has to allocate time
slots for 72 hours in a week.
2.1 First Stage
Coming to the constraints we have imposed, the fuzzy bi - partite
graph used in the first stage consists of four nodes on the left side
which correspond to four hours per week handled by a teacher for
a particular semester. Two nodes on the right side correspond to
the two semesters to which the concerned teacher is teaching.
In the fuzzy graph shown below, Ti1, Ti2 , Ti3 and Ti4 represent the
1st, 2nd, 3rd and 4th time slots assigned to a teacher Ti in a week
(i varies from 1 to 9). Sj and Sk are the two semesters handled by
Ti (j and k vary from 1 to 3, j k). The corresponding adjacency
matrix is as shown in the Table 1.
Ti1
wi1j
wi2j
Sj
wi3j
Ti2
wi4j
wi1k
wi2k
Ti3
wi3k
Sk
wi4k
Ti4
Figure 1. Fuzzy graph of first stage.
Table 1. Adjacency matrix for the first stage.
Ti1
Ti2
Ti3
Ti4
Sj
Sk
Ti1
0
0
0
0
1
1
Ti2
0
0
0
0
1
1
Ti3
0
0
0
0
1
1
Ti4
0
0
0
0
1
1
Sj
1
1
1
1
0
0
Sk
1
1
1
1
0
0
14
International Journal of Computer Applications (0975 – 8887)
Volume 6– No.2, September 2010
T1
Since there are six working days in a week (Monday to Saturday),
we use six colors to color the above fuzzy graph. If r and s are two
different colors, we use the color difference table d (r, s) = r
s . Membership table is based on the priorities given by a
teacher. The membership values can be ‘l’, ‘m’ or ‘h’ which
correspond to ‘low’, ‘medium’ and ‘high’ respectively. Block
diagram for the first stage is shown below.
wij
T2
T1
S1
wij
T3
T4
Di
Adjacency
Matrix
Sj
Semester i
wij
Edge
coloring of
fuzzy graph.
Ti
S2
Di
T5
Di
T6
Di
wij
S3
Sk
Color
Difference
Membership
Table
Table
Semester k
Di
T7
Di
wij
T8
Di
T9
Di
Figure 3. Fuzzy graph of second stage.
Figure 2. Block diagram of first Stage.
Edge coloring algorithm in the first stage takes as input adjacency
matrix, color difference table and corresponding membership
table and is executed nine times corresponding to nine teachers.
In each iteration, the color allocated for an edge corresponds to a
day of the week and indicates the day on which the particular
teacher engages the particular semester. The output of the first
stage becomes the input to the second stage.
The constraints that are satisfied in the first stage are the
following.
1. For each semester, exactly four slots in a week are allocated
for
a teacher who teaches that semester.
2. Each teacher will engage a particular semester for maximum
one slot in a day.
2.2 Second Stage
The fuzzy bi partite graph used in the second stage consists of
nine nodes on the left side which correspond to nine teachers.
There are three nodes on the right side which correspond to three
semesters.
T1
T2
T3
T4
T5
T6
T7
T8
T9
S1
S2
S3
T1
0
0
0
0
0
0
0
0
0
…
…
…
T2
0
0
0
0
0
0
0
0
0
…
…
…
T3
0
0
0
0
0
0
0
0
0
…
…
…
T4
0
0
0
0
0
0
0
0
0
…
…
…
T5
0
0
0
0
0
0
0
0
0
…
…
…
T6
0
0
0
0
0
0
0
0
0
…
…
…
T7
0
0
0
0
0
0
0
0
0
…
…
…
T8
0
0
0
0
0
0
0
0
0
…
…
…
T9
0
0
0
0
0
0
0
0
0
…
…
…
S1
…
…
…
…
…
…
…
…
…
0
0
0
S2
…
…
…
…
…
…
…
…
…
0
0
0
S3
…
…
…
…
…
…
…
…
…
0
0
0
Table 2. Adjacency matrix for the second stage.
In the second stage, the edge coloring algorithm is executed six
times corresponding to six days in a week. In each iteration, the
adjacency matrix is created dynamically by extracting the data
available at the output of the first stage. In other words, by
referring to the teachers who are teaching on a given day for a
given semester, the adjacency matrix is created dynamically in
each iteration. Hence the edges in figure 3 are shown by dotted
lines and the entries connecting the edges Ti with Sj (1 ≤ i ≤ 9 and
1 ≤ j ≤ 3) in Table 2 are also shown by dotted lines.
15
International Journal of Computer Applications (0975 – 8887)
Volume 6– No.2, September 2010
Seven colors are considered for Monday to Friday (iteration 1 to
iteration 5) which correspond to seven slots in a day. For Saturday
(iteration 6), the number of colors considered is four
corresponding to four slots on Saturday. The membership table for
each iteration is also created dynamically. The block diagram for
the second stage is shown in the figure given below.
Matrix
Of a
Fuzzy
Graph
Semester 2
Color
Difference
Semester 3
Table
Time table generated
Input from 1st Stage
Dynamically
created
Membership
Table
Figure 4. Block diagram of second Stage.
In each iteration which represents a particular day, timeslots are
allocated for all the nine teachers. Finally, the entire Time table is
generated.
The constraints that are satisfied in the second stage are the
following.
1.
2.
Step 7: For each day, generate the color difference table and
execute the edge coloring algorithm which again takes
adjacency matrix, membership table and color difference
table as inputs.
Step 8: Time table is generated by assigning the colors generated
by the edge coloring algorithm to different time slots in a
day.
Edge
Coloring
Adjacency
Semester 1
Step 6: For each day, generate the adjacency matrix and
membership table dynamically for the second stage by
mapping the output generated in the first stage.
In any given time slot, each teacher can teach at most
one semester and each semester can be taught by at
most one teacher.
If a teacher handles classes for two semesters in a day,
the gap between the two slots is controlled by
membership values assigned to the edges connecting
teachers and semesters.
3. ALGORITHM TO GENERATE TIME
TABLE USING EDGE COLORING OF A
FUZZY GRAPH
STAGE 1:
Step 1: Allocate two semesters for each teacher.
Step 2: Generate the adjacency matrix corresponding to four hours
in a week for each semester for each teacher.
Step 3: Generate the color difference table for six colors which
corresponding to six days in a week.
Step 4: For each teacher, get the membership table and execute
the edge coloring algorithm which takes adjacency
matrix, membership table and color difference table as
inputs.
Step 9: Display the final Timetable of each semester and also of
Individual Teachers.
Example 3.1:
Consider an example where there are nine teachers T1, T2,…..,T9
who take classes for three semesters S1, S2 and S3. Assume that
teachers T1, T2 and T3 teach for semesters S1 and S2, teachers T4,
T5 and T6 teach for semesters S1 and S3, teachers T7, T8 and T9
teach for semesters S2 and S3.
Using the above algorithm, we generate Time table which
satisfies the constraints given in section 1. For the first stage, we
consider the fuzzy graph of figure 1 and the adjacency matrix of
Table 1. Nine membership tables for the first stage based on the
priorities given by nine teachers T1, T2,…...T9 are given below.
Table 3 Membership tables for nine teachers for the first
stage of example 3.1
Teacher 1:
T11
T12
T13
T14
S1
S2
T11
0
0
0
0
l
l
T12
0
0
0
0
m
h
T13
0
0
0
0
m
m
T14
0
0
0
0
h
h
S1
l
m
m
h
0
0
S2
l
h
m
h
0
0
Teacher 2:
T21
T22
T23
T24
S1
S2
T21
0
0
0
0
m
l
T22
0
0
0
0
l
h
T23
0
0
0
0
l
m
T24
0
0
0
0
h
l
S1
m
l
l
h
0
0
S2
l
h
m
l
0
0
Teacher 3:
Step 5: The output generated by the edge coloring algorithm
assigns the colors to days of a week.
STAGE 2:
16
International Journal of Computer Applications (0975 – 8887)
Volume 6– No.2, September 2010
Teacher 9:
T31
T32
T33
T34
S1
S2
T31
0
0
0
0
h
h
T32
0
0
0
0
m
m
T33
0
0
0
0
h
l
T34
0
0
0
0
l
m
S1
h
m
h
l
0
0
S2
h
m
l
m
0
0
Teacher 4:
T41
T42
T43
T44
S1
S3
T41
0
0
0
0
h
m
T42
0
0
0
0
m
h
T43
0
0
0
0
l
h
T44
0
0
0
0
h
l
S1
h
m
l
h
0
0
S3
m
h
h
l
0
0
T51
0
0
0
0
l
h
T52
0
0
0
0
m
h
T53
0
0
0
0
l
m
T54
0
0
0
0
h
m
S1
l
m
l
h
0
0
S3
h
h
m
m
0
0
T61
0
0
0
0
m
m
T62
0
0
0
0
h
l
T63
0
0
0
0
l
m
T64
0
0
0
0
m
h
S1
m
h
l
m
0
0
S3
m
l
m
h
0
0
Teacher 5:
T51
T52
T53
T54
S1
S3
Teacher 6:
T61
T62
T63
T64
S1
S3
Teacher 7:
T71
T72
T73
T74
S2
S3
Teacher 8:
T81
T82
T83
T84
S2
S3
T71
T72
T73
T74
S2
S3
0
0
0
0
m
m
0
0
0
0
l
h
0
0
0
0
m
h
0
0
0
0
h
l
m
l
m
h
0
0
m
h
h
l
0
0
T81
0
0
0
0
h
l
T82
0
0
0
0
m
h
T83
0
0
0
0
l
m
T84
0
0
0
0
h
h
S2
h
m
l
h
0
0
S3
l
h
m
h
0
0
T91
T92
T93
T94
S2
S3
T91
0
0
0
0
l
m
T92
0
0
0
0
h
l
T93
0
0
0
0
m
h
T94
0
0
0
0
m
m
S2
l
h
m
m
0
0
S3
m
l
h
m
0
0
Output generated by the first stage for the membership tables
considered above is as shown in the Table given below.
Table 4. Output generated by first stage for example 3.1.
Semester 1:
T1
T2
T3
T4
T5
T6
Mon
1
1
1
1
1
1
Tue
1
1
1
1
1
1
Wed
0
1
0
1
0
1
Thur
1
1
1
0
1
1
Fri
0
0
0
1
0
0
Sat
1
0
1
0
1
0
Mon
1
1
1
1
1
1
Tue
1
1
1
1
1
1
Wed
0
1
0
1
0
1
Thur
1
1
1
0
1
0
Fri
0
0
0
1
0
1
Sat
1
0
1
0
1
0
Mon
1
1
1
1
1
1
Tue
1
1
1
1
1
1
Wed
1
0
1
1
0
1
Thur
0
1
1
0
1
0
Fri
1
0
0
1
0
1
Sat
0
1
0
0
1
0
Semester 2:
T1
T2
T3
T7
T8
T9
Semester 3:
T4
T5
T6
T7
T8
T9
The output generated by the first stage gives information about
the teachers who are all taking classes for a particular semester on
a particular day. For example, on Wednesday, teachers T2, T4 and
T6 are engaging classes for semester 1, teachers T2, T7 and T9 are
engaging classes for semester 2 and teachers T4, T6, T7 and T9 are
engaging classes for semester 3.
We now look at the adjacency matrix generated dynamically for
the second stage by mapping the output generated in the first
stage. The corresponding membership tables for the second stage
are given below.
17
International Journal of Computer Applications (0975 – 8887)
Volume 6– No.2, September 2010
Table 5. The membership table for the second stage of
example 3.1.
T1
T2
T3
T4
T5
T6
T7
T8
T9
S1
S2
S3
T1
0
0
0
0
0
0
0
0
0
0
0
0
T2
0
0
0
0
0
0
0
0
0
0
0
0
T3
0
0
0
0
0
0
0
0
0
0
0
0
T4
0
0
0
0
0
0
0
0
0
m
0
h
T5
0
0
0
0
0
0
0
0
0
0
0
0
T6
0
0
0
0
0
0
0
0
0
0
0
0
T7
0
0
0
0
0
0
0
0
0
0
h
m
T8
0
0
0
0
0
0
0
0
0
0
0
0
T9
0
0
0
0
0
0
0
0
0
0
m
m
S1
0
0
0
m
0
0
0
0
0
0
0
0
S2
0
0
0
0
0
0
h
0
m
0
0
0
S3
0
0
0
h
0
0
m
0
m
0
0
0
Monday:
T1
T1
T2
T3
T4
T5
T6
T7
T8
T9
S1
S2
S3
0
0
0
0
0
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
0
0
0
0
h
l
0
h
0
0
0
0
Wednesday:
Saturday:
T1
T2
T3
T4
T5
T6
T7
T8
T9
S1
S2
S3
T1
T2
T3
T4
T5
T6
T7
T8
T9
S1
S2
S3
T1
0
0
0
0
0
0
0
0
0
m
h
0
T1
0
0
0
0
0
0
0
0
0
0
0
0
T2
0
0
0
0
0
0
0
0
0
0
0
0
T2
0
0
0
0
0
0
0
0
0
m
h
0
T3
0
0
0
0
0
0
0
0
0
l
m
0
T3
0
0
0
0
0
0
0
0
0
0
0
0
T4
0
0
0
0
0
0
0
0
0
0
0
h
T4
0
0
0
0
0
0
0
0
0
h
0
m
T5
0
0
0
0
0
0
0
0
0
h
0
m
T5
0
0
0
0
0
0
0
0
0
0
0
0
T6
0
0
0
0
0
0
0
0
0
0
0
0
T6
0
0
0
0
0
0
0
0
0
h
0
h
T7
0
0
0
0
0
0
0
0
0
0
0
0
T7
0
0
0
0
0
0
0
0
0
0
m
m
T8
0
0
0
0
0
0
0
0
0
0
l
h
T8
0
0
0
0
0
0
0
0
0
0
0
0
T9
0
0
0
0
0
0
0
0
0
0
h
m
T9
0
0
0
0
0
0
0
0
0
0
h
m
S1
m
0
l
0
h
0
0
0
0
0
0
0
S1
0
m
0
h
0
h
0
0
0
0
0
0
S2
h
0
m
0
0
0
0
l
h
0
0
0
S2
0
h
0
0
0
0
m
0
h
0
0
0
S3
0
0
0
h
m
0
0
h
m
0
0
0
S3
0
0
0
m
0
h
m
0
m
0
0
0
18
International Journal of Computer Applications (0975 – 8887)
Volume 6– No.2, September 2010
Considering the priorities of nine teachers given in Table 3, the
final time table is generated and is shown in the Table given
below.
Table 6. Final Time Table generated.
Semester 1
Mon
Tue
Wed
Thurs
Fri
Sat
slot1
T2
T1
T2
T1
T1
slot2
T1
T3
T2
T3
slot3
T4
T5
T4
T3
T4
T5
slot4
T3
T2
-
slot5
T5
T6
T5
-
slot6
T4
T6
-
slot7
T6
T6
-
slot2
T8
T2
T8
slot3
T2
T1
T1
T9
T1
slot4
T9
T9
T2
-
slot5
T3
T7
T8
-
slot6
-
slot7
T7
T8
T7
T2
-
slot1
T4
T4
T4
slot2
T5
T7
-
slot3
T6
T9
T6
slot4
T7
T8
-
slot5
T8
T5
T7
slot6
-
slot7
T9
T6
T9
T5
T6
-
-
-
-
T8
T4
T5
-
T7
T8
-
T9
-
-
-
Semester 2
Mon
Tue
Wed
Thurs
Fri
Sat
slot1
T1
T3
T9
T3
T7
T3
Semester 3
Mon
Tue
Wed
Thur
s
Fri
Sat
4. CONCLUSION
Time table generated using Edge coloring of a Fuzzy graph always
ensures non conflicting course time table. However, it is difficult
to implement certain constraints in Time Table problem using
edge coloring algorithm because it always starts coloring from
first available color. If the algorithm can be modified in such a
way that it starts coloring the edges of a fuzzy graph by choosing
the available colors randomly instead of in order, we should be
able to implement other constraints too.
5. REFERENCES
[1] Nguyen Duc Thanh, Solving Timetabling Problem Using
Genetic and Heuristic Algorithms, Eighth ACIS International
Conference on Software Engineering, Artificial Intelligence,
Networking, and Parallel/Distributed Computing, IEEE 2007,
P 472 – 477.
[2] G.A. Neufeld and J. Tartar, Graph Coloring Conditions for the
Existence of
Solutions to the Timetable Problem,
Communication of ACM, August 1974, Volume 17,Number 8, P
450 – 453.
[3] Ben Paechter, Henri Luchian, Mihai Petriuc, Two Solutions to
the General Timetable Problem Using Evolutionary Methods,
IEEE 1994, P 300 – 305.
[4] Mllena Karova, Solving Timetabling Problems Using Genetic
Algorithms, 27th International Spring Seminar on Electronics
Technology, IEEE 2007, P 96 – 98.
[5] V. Ramaswamy and. Poornima B. Edge coloring of a Fuzzy
Graph, Advances in Fuzzy Mathematics, Volume 4, Number 1,
2009, P 49 – 58.
19