A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
Role Model of Graph Coloring Application in Labelled 2D Line Drawing Object A. A. Samah
[email protected]
Faculty Science Computer and Information Systems Universiti Teknologi Malaysia Skudai, 81310, Johor, Malaysia
M. Z. Matondang
[email protected]
Faculty Science Computer and Information Systems Universiti Teknologi Malaysia Skudai, 81310, Johor, Malaysia
H. Haron
[email protected]
Faculty Science Computer and Information Systems Universiti Teknologi Malaysia Skudai, 81310, Johor, Malaysia
H. A. Majid
[email protected]
Faculty Science Computer and Information Systems Universiti Teknologi Malaysia Skudai, 81310, Johor, Malaysia
N. K. Ibrahim
[email protected]
Faculty Information & Communication Technology Universiti Teknikal Malaysia Melaka Durian Tunggal, 76100, Melaka, Malaysia
Abstract Several researches had worked on the development of sketch interpreters. However, very few of them gave a complete cycle of the sketch interpreter which can be used to transform an engineering sketch to a valid solid object. In this paper, a framework of the complete cycle of the sketch interpreter is presented. The discussion in this paper will stress out on the usage of line labelling and graph coloring application in the validation of two dimensional (2D) line drawing phase. Both applications are needed to determine whether the given 2D line drawing represent possible or impossible object. In 2008, previous work by Matondang et al., has used line labelling algorithm to validate several 2D line drawings. However, the result shows that line labelling algorithm itself, is not adequate, as the algorithm does not have a validation technique for the result. Therefore, in this research study, it is going to be shown that if a 2D line drawing is valid as a possible object by using the line labelling algorithm, then it can be colored using graph coloring concept with a determineable minimum numbers of color needed. This is equal in vice versa. By that way, it is said that the 2D line drawings is valid. The expected output from this phase is a validlabeled of 2D line drawing with different colors at each edge and ready for the reconstruction phase. As a preliminary result, a high programming language MATLAB R2009a and several primitive 2D line drawings has been used and presented in this paper to test the graph coloring concept in labeled 2D line drawing. Keywords: Engineering Sketch, Line Labelling, Graph Coloring.
1. INTRODUCTION Sketching generally means freehand drawing. An engineering sketch is a preliminary design in the life cycle of an engineering product design namely in the conceptual stage [9]. A process flow in engineering design such as transformation of twodimensional (2D) drawing from its engineering sketch into threedimensional (3D) object is known as a sketch interpreter. One of a complete cycle of the sketch interpreter has been presented in the year
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (3) : 2011
82
A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
2008 by Matondang et al., [16]. The framework shows exactly the complete cycle of the transformation of an object from an engineering sketch 2D line drawing to a valid solid 3D solid object. The framework consists of five phases. First is the interpretation of engineering sketch which is also known as the image processing part, second is the representation of the regular line drawing, third is the validation of the 2D line drawing, fourth is the reconstruction of the validated 2D line drawing into threedimensional (3D) solid object, and the final phase is representation of the reconstructed 3D solid object. Five methods have been used to carry out all processes for each phase inside. They are thinning algorithm, chaincode scheme, line labelling concept, neural network and mathematical modeling. In this paper, the authors will stress out the discussion on the usage of line labelling and graph coloring application that will be used in the validation phase of the framework. Both methods are used to determine whether the given 2D line drawing represent possible or impossible object. The discussion point out that this research is need to be done because the uses of line labelling concept itself [16] is not enough to determine whether the given 2D line drawing is representing possible or impossible object. Furthermore, the line labelling concept itself does not have any validation method for its own result. Hence, by adding the graph coloring application in the validation phase, the authors expecting the result as a validlabelled of 2D line drawing with different colors at each edge and ready for the reconstruction phase as the newly enhanced output of the framework, specifically to the validation phase. Also it is expected that the result of this research study could be used as a reference for any further researches on line labelling, precisely the graph coloring. These problem backgrounds and reasons motivate the requirement to undertake the research. The discussion in this paper is managed as follow. The next Section 2 and 3 discuss some literatures and related issues on line labelling and graph coloring concept. Section 4 presents the discussions of the proposed idea and the preliminary results, while Section 5 gives the conclusion and suggestion for future researches.
2. LINE LABELLING A brief introduction to line labelling is presented in this section. By definition, line labelling is a method for interpreting 3D structure of a 2D line drawing, in which labels are placed on lines to indicate their relative position in space and their convexity [7]. The works on line labelling have been carry out since the early70’s, started by Huffman [10], known as the first who worked on the related study concerning the impossible object as nonsense sentences. Initially, it is used to interpret trihedral of planar objects as highlighted by Huffman [10] and Clowes [2]. The years after, the convention has already been extended by Waltz [26] and it is known as HuffmanClowesWaltz line labelling. Figure 1 shows the HuffmanClowesWaltz line labelling scheme. The convention has four types of line labelling scheme, known as Ltype, Wtype, Ytype, and Ttype and it is limited to a junction with three maximum line incidents. However, it has great impact on the research interpreting and reconstructing of 3D object from a single projection of line drawing.
FIGURE 1: HuffmanClowesWaltz line labelling scheme. The growth of line labelling makes the researchers intense to use the method in their works and enhance the ability. Line labelling has been used with vertices more complex than
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (3) : 2011
83
A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
trihedral such as curved surface by Malik [14], transparent solids by Sugihara [22] and drawings with shadows by Waltz [26], Grimstead and Martin [8], Salem and Young [21]). Some previous works show the uses of line labelling in various applications. Jenkins and Martin [12] showed the uses of line labelling in reconstructing a 3D object from 2D line drawing. Varley and Martin ([24], [25]) also worked on the same issues. They converted a 2D sketch with hidden lines removed from a single polyhedral object into a boundary representation by improving Grimstead’s system [7]. Also, Varley and Martin [23] have used the line labelling together with other reconstruction methods like line parallelism, corner orthogonality and a new function, junction label pair (JLP). They estimated the depth value and inflate the drawing 3D space. Cooper [3] introduced novel constraints between unconnected lines or junctions, based on parallel lines, cycles of lines or colinearity. Other researchers such as Salem and Young [21] and Myers and Hancock [18] had attempted to use soft computing approaches in line labelling representation. Salem and Young [21] tried to adopt the Hopfield and the Tank model in representing 2D sketch with higher order neural network. They assumed that each type of label is represented by neuron. Meanwhile, Myers and Hancock [18] used genetic algorithm to find the optimal set of algorithm control parameters for line labelling. Apart of those works, Varley et al., [25] have studied different issues. They are explaining that the original purpose of line labelling was as a method of identifying and rejecting impossible drawings. Impossible object can be represented by a regular 2D line drawing, as it cannot be reconstructed into a valid 3D object because the object does not exist. However, the impossible object is designed uniquely to test mind and previous works such as the work by Cowan [4] which has been done in picture interpretation to indentify the correctness of this type of line drawing. Figure 2 shows two examples of the impossible objects.
FIGURE 2: Impossible objects (redrawn from [10]). Back to the issues discuss in this research study, the line labelling concept has been used to represent 2D and 3D object. Line labelling concept has also been used to validate whether the 3D object which has been represented by a 2D line drawing is a possible or impossible object. Table 1 shows the line labelling scheme on a 2D line drawing which represent a 3D solid object Lblock.
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (2) : 2011
84
A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
TABLE 1: Example of line labelling on a 3D solid object Lbock. 2D line drawing for a 3D solid object Lblock
Line labelling scheme
Example of the labelled line
Ltype
{(abc), (bcd ),( fgh)}
Wtype
{(hbj, a),(dfk , e), ( jkd , i)}
Ytype
{(ice, d ), (ica, j ), ( gie, k )}
Ttype

The data gathered above have been fed into worksheets to perform statistical analysis on the results in groupprojects, project’s individual reports, and exams. In addition, the results of students’ attainment in the assignment and the exam have been compared, and particularly in similar subject areas, for example requirements analysis and software architecture. Also, students’ and tutors’ feedback have been analyzed.
3. GRAPH COLORING A brief discussion to graph coloring literatures is presented in this section. By definition, graph coloring is a special case of graph labelling, with color used as the label. By the means, there are no two adjacent vertices, or edge, or face are assigned by the same color. Therefore, there are three kinds of graph coloring, known as vertex coloring, edge coloring and face coloring. Given a graph G (V , E ) with V = {v1 , v2 , K , vn } is the set of vertices in G and
E = {e1 , e2 ,K , em } is the set of edge in G, then the chromatic numbers χ (G ) = k is defined as the minimum numbers of colors needed to color graph G (V , E ) . The property: assumed G (V , E ) is a graph and G * = (V , C ) is a mapping function f : v → c with c ∈ C is a finite set of colors, such that if ( v1v2 ) ∈ E then f (v1 ) ≠ f (v2 ) . This implies that the adjacent vertices are not assigned the same color [1]. In this paper, the discussion is been concentrated on the edge coloring. By definition, edge coloring of a graph G (V , E ) is a color assignment to each edge in G (V , E ) so that for each two adjacent edges e j and ek to a vertices vi , they do not share the same color. For details discussion about the graph coloring properties, readers are referred to Jensen and Toft [13], as the authoritative reference on graph coloring. In many cases, graph coloring is used to solve problems that may involve conflicts, or items that need to be separated [20]. Several applications previously done include separating chemicals in a lab work, separating animals in zoo, scheduling classes or exams, and the most common applications is coloring maps in order to separate distinct countries. IturriagaVelazquez [11] shows that the originated problems involving the fourcolor problem that is four colors enough to color the countries on world map without two countries with common boundary are assigned the same color. However, since the time, graph coloring is applied to many various fields of researches. Marx [15] explained in his paper about the applications of graph coloring in scheduling problem while Gaceb et al., [6] carried out physical layout segmentation for postal sorting system using the graph coloring application. Redl [19] used graph coloring approach for university timetabling in University of Houston, and Dobrolowski et al., [5] have developed Koala Graph Coloring Library, which is an open graph coloring library for real world applications. However, in this research study, it is attempted to use the concept of graph coloring to develop a role model as the validation of 2D line drawing which is representing 3D object. The validation will determine the represented 3D object as possible or
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (3) : 2011
85
A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
impossible object. The result of this research study is expected to give a better validation compare to the previous work by Matondang et al., [16] which only used line labelling algorithm to perform the validation. It is because the line labelling algorithm itself cannot be used as the validation tool or method to validate its labeled 2D line drawing. Therefore, the combination of both line labelling algorithm and graph coloring application can be useful in order to speed up or enhance the validation of 2D line drawing. It is also proposed as the performance of the graph coloring in many fields and gave the motivation to adapt in validating 2D line drawing.
4. ROLE MODEL OF GRAPH COLORING APPLICATION IN LABELED 2D LINE DRAWING OBJECT: A PRELIMINARY RESULT This section discusses the framework for the complete cycle of the sketch interpreter ([16], [17]). Interested readers could refer to the related references for details discussions of the framework. It is because the discussions in this paper, only focus on the validation phase as a part of the framework, which is about the role model of graph coloring application in labeled 2D line drawing. Figure 3 shows the framework for the complete cycle of the sketch interpreter.
FIGURE 3: Complete cycle of the sketch interpreter (Redrawn [17]). The following Theorem 1 gives a property to the graph coloring characteristic in terms of the numbers of color and the degree of vertices in a graph G. Theorem 1: Given G (V , E ) is a graph G with a set of vertices V and a set of edge E in G. The number of colors k$ needed to color each edge in G is equal to or greater than the maximum degree of the vertices in G
k$ ≥ max{deg(v), v ∈V }. Proof: Assumed vertex v ∈ V incident to m edges in E . Hence deg(v ) = m . Then there must be at least m number of colors needed to color every incident edge in vertex v . It is because for each edge which is incident to a vertex v cannot assign by the same color.
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (2) : 2011
86
A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
Hence, k$ ≥ max{deg(v), v ∈ V } with k$ is the numbers of color needed to color each edge E in G. In this research study, few assumptions have been made to simplify the implementation of the research work and its contributions. First, the tested 2D line drawings are assumed as an engineering sketch in a form of 2D line drawing that represent solid model. Second, the 2D line drawing is assumed to represent a valid solid model where all unwanted points or lines have been removed and there are no unconnected points or lines. Third, the solid model is assumed as a 2D line drawing with all informative lines shown. Fourth, there is only a maximum of one hidden point in the backside of the solid model. These assumptions make the proposed model more logical or otherwise the engineering sketch is not seen as solid models because the projection is parallel to the other faces of the object. In this case, it is impossible to interpret, reconstruct and represent the sketches as solid model and hence the analysis of the accuracy of the results will become simpler. Table 2 shows our preliminary result in this research study. There are four columns in the Table, with the first column shows the 2D line drawings and the second column shows the validation of the 2D line drawings using line labelling algorithm. Interested readers could refer to Matondang et al., ([16], [17]) for details discussion on the line labelling algorithm. The third column shows the labeled 2D line drawings are colored based on the graph coloring concept and the fourth column present some note. From the result showed in Table 2, our expected output which is a validlabeled of 2D line drawing with different colors at each edge and ready for the reconstruction phase has been achieved. However, in further research, we are going to extend the research by proving that for any given 2D line drawing, if it is can be validated as possible object by using line labelling algorithm, then it can be colored with the minimum numbers of color needed k by using graph coloring concept. The objects use to implement the concept of graph coloring given, also will be extended to more complex structures of 2D line drawings (not primitive). TABLE 2: Preliminary Result.
2D line drawing
Cube
Labeled 2D line drawing using line labelling algorithm
Validlabeled of 2D line drawing with different colors at each edge
• Red (R), Blue (B), Yellow (Y)
Role Model • Number of visible vertices = 7 • Number of visible edge = 8 • Numbers of color needed k = 3 • Number of visible vertices = 11 • Number of visible edge = 15 • Numbers of color needed k = 3
Lblock
• Red (R), Blue (B), Yellow (Y)
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (3) : 2011
87
A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
• Number of visible vertices = 15 • Number of visible edge = 21 • Numbers of color needed k = 3
Stairs
• Red (R), Blue (B), Yellow (Y) • Number of visible vertices = 9 • Number of visible edge = 12 • Numbers of color needed k = 3
pentahedralprism
• Red (R), Blue (B), Yellow (Y) • Number of visible vertices = 11 • Number of visible edge = 15 • Numbers of color needed k = 3
hexahedralprism
• Red (R), Blue (B), Yellow (Y) • Number of visible vertices = 4 • Number of visible edge = 5 • Numbers of color needed k = 3
trihedralpyramid
• Red (R), Blue (B), Yellow (Y) • Number of visible vertices = 5 • Number of visible edge = 7 • Numbers of color needed k = 4
kwartahedralpyramid
• Red (R), Blue (B), Yellow (Y), Green (G) • Number of visible vertices = 6 • Number of visible edge = 9 • Numbers of color needed k = 5
pentahedralpyramid
• Red (R), Blue (B), Yellow (Y), Green (G), Cyan (C)
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (2) : 2011
88
A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
• Number of visible vertices = 7 • Number of visible edge = 11 • Numbers of color needed k = 6
hexahedralpyramid
• Red (R), Blue (B), Yellow (Y), Green (G), Cyan (C), Magenta (M)
5. CONCLUSION AND FUTURE WORK This paper has presented a framework for the complete cycle of the sketch interpreter. However, the discussion in this paper stresses out on the usage of line labelling algorithm and graph coloring application in the validation of 2D line drawing phase only. It is needed to determine whether the given 2D line drawing represent possible or impossible object, before it is proceed to the next phase, namely reconstruction. However it is, in 2008, a previous work by Matondang et al., [16], has used line labelling algorithm to validate the 2D line drawing. But, the result shows that line labelling algorithm is not enough, because the algorithm does not have a validation technique for its own result. Therefore, in this research study, it is shown that if a 2D line drawing is valid as a possible object by the line labelling algorithm, then it can be colored using graph coloring concept with the minimum numbers of color needed is equal to k. The output from this phase is a validlabeled of 2D line drawing with different colors at each edge and ready for the reconstruction phase. In general, the inputs for the framework are points, lines and junctions of the engineering sketches which are irregular line drawings. Meanwhile, the output may vary up to the direction of the input. As the preliminary result, a high programming language MATLAB R2009a and several primitive 2D line drawings have been used to test the graph coloring concept in labeled 2D line drawing. The authors believed that this paper has presented an extended result of a series research paper which focuses on the validation of 2D line drawing based on line labelling algorithm and graph coloring concept only. In the next research paper, the discussion will going to prove the hypothesis which is: For any given 2D line drawing by an engineering sketch, if the 2D line drawing is determined as a possible object by the line labelling algorithm, then there are k colors that are the minimum numbers of color needed to color the 2D line drawing. Apart of that, it is realized some weaknesses of this series of research study. One of them is the line labelling algorithm which is still only covered for the trihedral pyramid but not for tetrahedral, pentahedral, hexahedral pyramid and so on. In future, the 2D line drawing used to implement this research will be extended to a more complex object instead of the primitive ones used in this paper. However, as a general conclusion, the combination of the methods use in the framework; thinning algorithm, chaincode scheme, line labelling, graph coloring, neural network, and mathematical modeling, has generated new invention in the development of sketch interpreter.
ACKNOWLEDGEMENTS The authors would like to thank Ministry of Higher Education Malaysia (MoHE) and Universiti Teknologi Malaysia for the Short Term Grant (Vot 77228) and Research Management Center (RMC), Universiti Teknologi Malaysia (UTM) for the support in making this projects success.
REFERENCES [1]
Baase S. and Van Gelder A., Computer Algorithms: Introduction to Design and rd Analysis, 3 Edn., Addison Wesley. 2000.
[2]
Clowes M. B. “On seeing things,” Artificial Intelligent, vol. 2, pp. 79116, 1971.
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (3) : 2011
89
A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
[3]
Cooper M. C., “Constraint Between Distant Lines in the Labeling of Line Drawings of Polyhedral Scene,” Intl. Journal of Computer Vision. vol. 73, no. 2, ACM Portal, pp. 195212, 2007.
[4]
Cowan T. M., “Organizing the Properties of Impossible Figures,” Perception, vol. 2, pp. 4156, 1977.
[5]
Dobrolowski T., Dereniowski D., and Kuszner L., Koala Graph Coloring Library: An Open Graph Coloring Library for Real World Applications, IT, Gdansk, Poland, May 2008.
[6]
Gaceb D., Eglin V., Lebourgeois F., and Emptoz H., “Application of Graph Coloring in th Physical Layout Segmentation,” IEEE 19 Intl. Conf. on Pattern Recognition (ICPR 2008), pp. 14, 2008.
[7]
Grimstead I. J., Interactive Sketch Input of Boundary Representation Solid Models, PhD Thesis, Univ. of Cardiff, UK. 1997.
[8]
Grimstead J. and Martin R. R., “Creating Solid Model From Single 2D Sketches”. Proceedings Third Symp. On Solid Modeling Applications. ACM SIGGRAPH. pp. 233337, 1995.
[9]
Haron H., Shamsuddin S. M. and Mohamed D., “Chain Code Algorithm in Deriving Tjunction and Region of a Freehand Skecth,” Jurnal Teknologi. vol. 40D, pp. 2536, 2004.
[10] Huffman D. A. “Impossible Object as Nonsense Sentences,” Machine Intelligence. Newyork: American Elsevier, vol. 6, pp. 295323, 1971. [11] IturriagaVelazquez C. C., Map Labeling Problems,”PhD Thesis, University of Waterloo, Ontorio: Canada, 1999. [12] Jenkins D. L. and R. R. Martin, “The importance of Freehand Sketching in Conceptual Design: Automatic Sketch Input,” In T.K. High and L. A. Stauffer, editors, Design Theory Methodology DTM93, vol. DE53, ASME, pp.115128, 1993. [13] Jensen T. R. and Toft, B. Graph Coloring Problems. WileyInterscience Series in Discrete Mathematics and Optimization. John Wiley & Sons Inc., New York. A Wiley Interscience Publication. 1995. [14] Malik J, “Interpreting Line Drawings of Curved Objects,” Int'l J. Computer Vision, vol. 1, pp. 73103, 1987. [15] Marx D., “Graph Coloring Problems and Their Applications in Schedulling,” Periodica of Polytechnica Ser. El. Eng. vol. 489, no. 1, pp. 1116, 2004. [16] Matondang M. Z., Mardzuki, S. and Haron, H., “Transformation of engineering sketch to th valid solid object,” Proc. of Intl. Conf. of The 9 Asia Pacific Industrial Engineering & th Management Systems (APIEMS 08) Conference and The 11 Asia Pacific Regional Meeting of International Foundation for Production Research, Dec. 2008, pp. 2707– 2715, 2008.
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (2) : 2011
90
A. A. Samah, M. Z. Matondang, H. Haron, H. A. Majid & N. K. Ibrahim
[17] Matondang M. Z., Samah A. A., Mardzuki S., Haron H., Majid H. A. and Ibrahim N. K., “A Hybrid Framework for Validation of Two Dimensional Line Drawing based on Line Labeling and Graph Coloring Algorithm”. 2010 International Conference on Intelligent Network and Computing (ICINC 2010). Kuala Lumpur, Malaysia. 26  28 November, 2010. Edt. Ms. Zhang Yushu. IEEE Catalog Number: CFP1076KPRT. ISBN: 9781424482702. Institute of Electrical and Electronics Engineers, Inc. vol. 2. pp. V249, 2010. [18] Myers R. and Hancock E. R., “Genetic Algorithm Parameter Sets for Line Labeling,” Pettern Recognition Letters, ACM Portal, vol. 18. No. 1113, pp. 13631371, 1997. [19] Redl T.A., University Timetabling Via Graph Coloring: an alternative approach, University of Houston, Houston, 2007. [20] Robinson L. A., Graph Theory for the Middle School, Master Thesis. Faculty of the Department of Mathematics. East Tennessee State University. UMI Number: 1436267. 2006. [21] Salem G. J. and Young T. Y., “Interpreting Line Drawings with Higher Order Neural Network,” IEEE Intl. Joint Conf. on Neural Network (IJCNN 91), vol. 1, pp. I713 – I721, 1991. [22] Sugihara K., Machine Interpretation of Line Drawings. Cambridge, Massachusetts: MIT Press. 1986. [23] Varley P. A. C. and Martin R. R., “Estimating Depth from Line Drawing. In Edt. K.Lee th and Patrikalakis”. Proc. 7 ACM Symposium on Solid Modeling and Applications, SM’02. ACM Press. pp. 180191, 2002. [24] Varley P. A. C. and Martin R. R., “A System for Constructing Boundary Representation Solid Models from a TwoDimensional Sketch,” IEEE Proc. Geometri Modelling and Processing, pp. 1332, 2000. [25] Varley P. A. C., Martin R. R. and Suzuki H., “Making the Most of using Depth Reasoning to Label Line Drawings of Engineering Objects,” ACM Symposium on Solid Modeling and Application, pp. 1332, 2004. [26] Waltz D. L. Understanding Line Drawings of Scenes with Shadows, In P. Winston, editor, The Physicology of Computer Vision, Mc Graw Hill, Newyork, pp.1991, 197
International Journal of Experimental Algorithms (IJEA), Volume (2) : Issue (3) : 2011
91