You are on page 1of 6

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 Professor and Head
B.I.E.T., Davangere. I.S. & E Department, B.I.E.T. Davangere.
Karnataka, India. Karnataka, India.

ABSTRACT 2. COURSE TIME TABLING PROBLEM


In this paper, we have developed an algorithm to generate a In general time tabling problem, we assume there are m teachers
course Time table satisfying certain constraints using Edge T1, T2…Tm who teach for n semesters S1, S2, …..Sn. Each teacher
coloring of a fuzzy graph. With examples, we show how these Ti teaches a subject for semester Sj for pi j periods in a week. This
constraints are satisfied. problem can be represented using a fuzzy bi partite graph and
the required time table can be generated using edge coloring of a
General Terms fuzzy graph. Edge coloring is applied at two different stages. In
Fuzzy Logic, Fuzzy Graph. 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.
Keywords
Edge coloring of a Fuzzy Graph, Time table problem. 2.1 First Stage
Coming to the constraints we have imposed, the fuzzy bi - partite
1. INTRODUCTION graph used in the first stage consists of four nodes on the left side
Edge coloring of graph arises in a variety of scheduling which correspond to four hours per week handled by a teacher for
applications. One such application [1] is Time table scheduling a particular semester. Two nodes on the right side correspond to
problem. In Time tabling problem, it is required to schedule all the two semesters to which the concerned teacher is teaching.
the courses in such a way that no two classes of the same course In the fuzzy graph shown below, Ti1, Ti2 , Ti3 and Ti4 represent the
are scheduled at the same time. If each edge color [2] represents a 1st, 2nd, 3rd and 4th time slots assigned to a teacher Ti in a week
time slot in the schedule, then an edge coloring of a graph
(i varies from 1 to 9). Sj and Sk are the two semesters handled by
represents a feasible time table for courses.
Ti (j and k vary from 1 to 3, j k). The corresponding adjacency
Time tabling problem involves factors such as teachers, classes matrix is as shown in the Table 1.
and courses. Various resources are rooms, time slots etc. Time
Ti1
tabling problem [3] is concerned with maximum utilization of the wi1j
available resources subject to a set of constraints and can be wi2j Sj
classified [4] into three main classes namely school time tabling,
course time tabling and examination time tabling. In this paper, Ti2 wi3j wi4j
we have attempted to give solution to course time tabling problem
using the concept of Edge coloring of a fuzzy graph.
wi1k
Using the definition of edge coloring of a fuzzy graph and wi2k
algorithm developed in our paper [5], we have attempted to Ti3
wi3k Sk
generate course Time table satisfying the following constraints.
Nevertheless, the solutions we propose can be applied to general wi4k
time tabling problem.
Ti4
1. We assume that the number of semesters is three.
2. Six subjects are to be taught by different teachers for each
Figure 1. Fuzzy graph of first stage.
semester.
3. Every teacher will be handling two subjects (of course, for
different semesters). Table 1. Adjacency matrix for the first stage.
4. Each subject should be taught for four hours in a week. Ti1 Ti2 Ti3 Ti4 Sj Sk
5. Classes are held for seven hours from Monday to Friday and for
four hours on Saturdays. Ti1 0 0 0 0 1 1
Ti2 0 0 0 0 1 1
We note that the department requires totally nine teachers for
teaching all the subjects and the department has to allocate time Ti3 0 0 0 0 1 1
slots for 72 hours in a week. 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 wij
different colors, we use the color difference table d (r, s) = r
T2
s . Membership table is based on the priorities given by a T1
teacher. The membership values can be ‘l’, ‘m’ or ‘h’ which
S1
correspond to ‘low’, ‘medium’ and ‘high’ respectively. Block wij
diagram for the first stage is shown below. T3

Di T4
wij S2
Edge Di

Semester i
Adjacency coloring of T5
Matrix fuzzy graph. Di
Sj

Ti
T6 wij
Di

Sk
S3
Di T7
Color Di
Semester k

Difference Membership T8 wij


Table Table Di

Di T9

Figure 2. Block diagram of first Stage. Figure 3. Fuzzy graph of second stage.

T1 T2 T3 T4 T5 T6 T7 T8 T9 S1 S2 S3
Edge coloring algorithm in the first stage takes as input adjacency T1 0 0 0 0 0 0 0 0 0 … … …
matrix, color difference table and corresponding membership
T2 0 0 0 0 0 0 0 0 0 … … …
table and is executed nine times corresponding to nine teachers.
In each iteration, the color allocated for an edge corresponds to a T3 0 0 0 0 0 0 0 0 0 … … …
day of the week and indicates the day on which the particular T4 0 0 0 0 0 0 0 0 0 … … …
teacher engages the particular semester. The output of the first
T5 0 0 0 0 0 0 0 0 0 … … …
stage becomes the input to the second stage.
T6 0 0 0 0 0 0 0 0 0 … … …
The constraints that are satisfied in the first stage are the
T7 0 0 0 0 0 0 0 0 0 … … …
following.
1. For each semester, exactly four slots in a week are allocated T8 0 0 0 0 0 0 0 0 0 … … …
for T9 0 0 0 0 0 0 0 0 0 … … …
a teacher who teaches that semester. S1 … … … … … … … … … 0 0 0
2. Each teacher will engage a particular semester for maximum
one slot in a day. S2 … … … … … … … … … 0 0 0
S3 … … … … … … … … … 0 0 0
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. Table 2. Adjacency matrix for the second stage.
There are three nodes on the right side which correspond to three In the second stage, the edge coloring algorithm is executed six
semesters. 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 Step 6: For each day, generate the adjacency matrix and
iteration 5) which correspond to seven slots in a day. For Saturday membership table dynamically for the second stage by
(iteration 6), the number of colors considered is four mapping the output generated in the first stage.
corresponding to four slots on Saturday. The membership table for Step 7: For each day, generate the color difference table and
each iteration is also created dynamically. The block diagram for execute the edge coloring algorithm which again takes
the second stage is shown in the figure given below. adjacency matrix, membership table and color difference
table as inputs.

Adjacency Edge Step 8: Time table is generated by assigning the colors generated
Semester 1 Coloring by the edge coloring algorithm to different time slots in a
Matrix
Of a day.
Dynamically
created Fuzzy Step 9: Display the final Timetable of each semester and also of
Input from 1st Stage

Time table generated


Graph Individual Teachers.
Semester 2

Example 3.1:
Consider an example where there are nine teachers T1, T2,…..,T9
Color
who take classes for three semesters S1, S2 and S3. Assume that
Difference Membership
Semester 3 teachers T1, T2 and T3 teach for semesters S1 and S2, teachers T4,
Table Table 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
Figure 4. Block diagram of second Stage. 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.
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 Table 3 Membership tables for nine teachers for the first
following. stage of example 3.1
1. In any given time slot, each teacher can teach at most Teacher 1:
one semester and each semester can be taught by at
most one teacher. T11 T12 T13 T14 S1 S2
2. If a teacher handles classes for two semesters in a day, T11 0 0 0 0 l l
the gap between the two slots is controlled by T12 0 0 0 0 m h
membership values assigned to the edges connecting T13 0 0 0 0 m m
teachers and semesters. T14 0 0 0 0 h h
S1 l m m h 0 0
3. ALGORITHM TO GENERATE TIME S2 l h m h 0 0
TABLE USING EDGE COLORING OF A
Teacher 2:
FUZZY GRAPH
T21 T22 T23 T24 S1 S2
STAGE 1:
T21 0 0 0 0 m l
Step 1: Allocate two semesters for each teacher. T22 0 0 0 0 l h
Step 2: Generate the adjacency matrix corresponding to four hours T23 0 0 0 0 l m
in a week for each semester for each teacher. T24 0 0 0 0 h l
S1 m l l h 0 0
Step 3: Generate the color difference table for six colors which
corresponding to six days in a week. S2 l h m l 0 0

Step 4: For each teacher, get the membership table and execute Teacher 3:
the edge coloring algorithm which takes adjacency
matrix, membership table and color difference table as
inputs.
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 T91 T92 T93 T94 S2 S3
T32 0 0 0 0 m m T91 0 0 0 0 l m
T33 0 0 0 0 h l T92 0 0 0 0 h l
T34 0 0 0 0 l m T93 0 0 0 0 m h
S1 h m h l 0 0 T94 0 0 0 0 m m
S2 h m l m 0 0 S2 l h m m 0 0
S3 m l h m 0 0
Teacher 4: Output generated by the first stage for the membership tables
T41 T42 T43 T44 S1 S3 considered above is as shown in the Table given below.
T41 0 0 0 0 h m
Table 4. Output generated by first stage for example 3.1.
T42 0 0 0 0 m h
T43 0 0 0 0 l h
Semester 1:
T44 0 0 0 0 h l
S1 h m l h 0 0 Mon Tue Wed Thur Fri Sat
S3 m h h l 0 0 T1 1 1 0 1 0 1
T2 1 1 1 1 0 0
Teacher 5: T3 1 1 0 1 0 1
T51 T52 T53 T54 S1 S3 T4 1 1 1 0 1 0
T51 0 0 0 0 l h T5 1 1 0 1 0 1
T52 0 0 0 0 m h T6 1 1 1 1 0 0
T53 0 0 0 0 l m
Semester 2:
T54 0 0 0 0 h m
S1 l m l h 0 0 Mon Tue Wed Thur Fri Sat
S3 h h m m 0 0
T1 1 1 0 1 0 1
T2 1 1 1 1 0 0
Teacher 6:
T3 1 1 0 1 0 1
T61 T62 T63 T64 S1 S3 T7 1 1 1 0 1 0
T61 0 0 0 0 m m T8 1 1 0 1 0 1
T62 0 0 0 0 h l T9 1 1 1 0 1 0
T63 0 0 0 0 l m
T64 0 0 0 0 m h Semester 3:
S1 m h l m 0 0
Mon Tue Wed Thur Fri Sat
S3 m l m h 0 0
T4 1 1 1 0 1 0
Teacher 7: T5 1 1 0 1 0 1
T71 T72 T73 T74 S2 S3
T6 1 1 1 1 0 0
T71 0 0 0 0 m m T7 1 1 1 0 1 0
T72 0 0 0 0 l h T8 1 1 0 1 0 1
T73 0 0 0 0 m h T9 1 1 1 0 1 0
T74 0 0 0 0 h l
S2 m l m h 0 0
The output generated by the first stage gives information about
S3 m h h l 0 0
the teachers who are all taking classes for a particular semester on
Teacher 8: a particular day. For example, on Wednesday, teachers T2, T4 and
T6 are engaging classes for semester 1, teachers T2, T7 and T9 are
T81 T82 T83 T84 S2 S3
engaging classes for semester 2 and teachers T4, T6, T7 and T9 are
T81 0 0 0 0 h l engaging classes for semester 3.
T82 0 0 0 0 m h
We now look at the adjacency matrix generated dynamically for
T83 0 0 0 0 l m
the second stage by mapping the output generated in the first
T84 0 0 0 0 h h
stage. The corresponding membership tables for the second stage
S2 h m l h 0 0
are given below.
S3 l h m h 0 0
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.
Monday: 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
T1 T2 T3 T4 T5 T6 T7 T8 T9 S1 S2 S3
T2 0 0 0 0 0 0 0 0 0 0 0 0
T1 0 0 0 0 0 0 0 0 0 l h 0
T3 0 0 0 0 0 0 0 0 0 0 0 0
T2 0 0 0 0 0 0 0 0 0 h m 0
T4 0 0 0 0 0 0 0 0 0 m 0 h
T3 0 0 0 0 0 0 0 0 0 l h 0
T5 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 h 0 l
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
T6 0 0 0 0 0 0 0 0 0 m 0 m
T8 0 0 0 0 0 0 0 0 0 0 0 0
T7 0 0 0 0 0 0 0 0 0 0 m l
T9 0 0 0 0 0 0 0 0 0 0 m m
T8 0 0 0 0 0 0 0 0 0 0 l m
S1 0 0 0 m 0 0 0 0 0 0 0 0
T9 0 0 0 0 0 0 0 0 0 0 l h
S2 0 0 0 0 0 0 h 0 m 0 0 0
S1 l h l m h m 0 0 0 0 0 0
S3 0 0 0 h 0 0 m 0 m 0 0 0
S2 h m h 0 0 0 m l l 0 0 0

S3 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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 4. CONCLUSION


final time table is generated and is shown in the Table given Time table generated using Edge coloring of a Fuzzy graph always
below. ensures non conflicting course time table. However, it is difficult
Table 6. Final Time Table generated. to implement certain constraints in Time Table problem using
edge coloring algorithm because it always starts coloring from
Semester 1
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
slot1 slot2 slot3 slot4 slot5 slot6 slot7 the available colors randomly instead of in order, we should be
Mon T2 T1 T4 T3 T5 - T6 able to implement other constraints too.
Tue T1 T3 T5 T2 T6 T4 -
Wed T2 - T4 - - T6 -
Thurs T1 T2 T3 - T5 - T6 5. REFERENCES
Fri - - T4 - - - -
Sat T1 T3 T5 - - - - [1] Nguyen Duc Thanh, Solving Timetabling Problem Using
Genetic and Heuristic Algorithms, Eighth ACIS International
Conference on Software Engineering, Artificial Intelligence,
Semester 2 Networking, and Parallel/Distributed Computing, IEEE 2007,
slot1 slot2 slot3 slot4 slot5 slot6 slot7 P 472 – 477.
Mon T1 T8 T2 T9 T3 - T7
[2] G.A. Neufeld and J. Tartar, Graph Coloring Conditions for the
Tue T3 T2 T1 T9 T7 - T8 Existence of Solutions to the Timetable Problem,
Wed T9 - - T2 - - T7 Communication of ACM, August 1974, Volume 17,Number 8, P
Thurs T3 - T1 - T8 - T2 450 – 453.
Fri T7 - T9 - - - -
Sat T3 T8 T1 - - - - [3] Ben Paechter, Henri Luchian, Mihai Petriuc, Two Solutions to
the General Timetable Problem Using Evolutionary Methods,
Semester 3 IEEE 1994, P 300 – 305.

slot1 slot2 slot3 slot4 slot5 slot6 slot7 [4] Mllena Karova, Solving Timetabling Problems Using Genetic
Mon T4 T5 T6 T7 T8 - T9 Algorithms, 27th International Spring Seminar on Electronics
Tue T4 T7 T9 T8 T5 - T6 Technology, IEEE 2007, P 96 – 98.
Wed T4 - T6 - T7 - T9
[5] V. Ramaswamy and. Poornima B. Edge coloring of a Fuzzy
Thur Graph, Advances in Fuzzy Mathematics, Volume 4, Number 1,
T5 T6 - - - - T8
s 2009, P 49 – 58.
Fri T4 - T7 - T9 - -
Sat T5 - T8 - - - -

19

You might also like