UNIVERSITY OF MORATUWA SRI LANKA 4 ----- • •-• • ' ^ T ' ^ i / x p ^ ^ ' IMPLEMENTATION OF OPERATIONAL RESEARCH MODELS IN JAVA PROGRAMMING Master of Science in Operational Research Department of Mathematics January 2005 ^.%(o^ University of Moratuwa 84145 SOMASUNDARAM HEMANAND i 8 4 1 4 5 IMPLEMENTATION OF OPERATIONAL RESEARCH MODELS IN JAVA PROGRAMMING SOMASUNDARAM HEMANAND This thesis was submitted to the department of Mathematics University of Moratuwa is partial fulfillment of the requirements for the degree of Master of Science Department of Mathematics University of Moratuwa Sri Lanka January 2005 ii D E C L A R A T I O N I hereby assure that this project report titled "IMPLEMENTATION OF OPERATIONAL RESEARCH MODELS IN JAVA PROGRAMMING", is absolutely my own work and has never been produced earlier so far. Registration N o : PG/OR /11 /2000 I assure that out of the best of my knowledge, that the information given is true and correct. Dr.M.Indralingam (Supervisor) Senior Lecturer University of Moratuwa, Sri Lanka Name Signature Somasundaram Hemanand iii 1 ABSTRACT The selected area for Project is "IMPLEMENTATION OF OPERATIONAL RESEARCH MODELS IN JAVA PROGRAMMING". The idea of this thesis is to conduct a research activity about Operational Research education, difficulties in present graph Ne twork theory Algorithms methods , Java programming education , incorporating Java Applets for Operational Research i education and finally to develop a applets learning / teaching system. The objectives of developing visual processors to simulate the teaching process of graph Network theory algorithms and the exposit ion of their development have been set out by the terms of reference as follows: 1 . Fill the void created by the lack o f affordable Computer aided learning (CAL) software in the field of Graph Theory. 2. Encourage software developers to focus more on the development of ^ affordable CAL systems by providing them with the basic structure of such designs. This project was based on Structure Systems Analysis design Method (SSADM). Java Development kit 1.3 (J.D.K 1.3) is used to creating the required system. > iv ACKNOWLEDGMENT I like to express my deep gratitude and thanks to my supervisor Dr.M.Indralingam, Senior Lecturer , University o f Moratuwa, Sri Lanka, for his excellent guidance and lectures, to write and complete this project work. I would like to extend my sincere acknowledgements to all my colleges for their guidance and help me to complete this project successfully. Finally, my heartfelt thank goes to my wife, my parents, sister and brother for their encouragement, motivation and assistance. S O M A S U N D A R A M HEMANAND January 2005. T A B L E O F C O N T E N T S CONTENTS PAGE NUMBER Title i Dedication ii Copyright® iii Abstract iv Acknowledgement v Contents vi List o f figures ix CHAPTER - 01 INTRODUCTION 1.1 I N T R O D U C T I O N 2 1.2 S C O P E O F T H E P R O J E C T 4 1.3 P R O J E C T D E S C R I P T I O N 6 1.4 R E V I E W O F C H A P T E R S 7 CHAPTER - 02 OPERATIONAL RESEARCH 2 . 1 I N T R O D U C T I O N 9 2 . 2 O P E R A T I O N A L R E S E A R C H 9 2 . 3 N E W S T R A T E G I E S A N D T E A C H E R ' S R O L E 1 1 2.4 S U M M A R Y 12 CHAPTER - 03 JAVA PROGRAMMING 3 . 1 I N T R O D U C T I O N T O J A V A P R O G R A M M I N G 14 3 . 2 J A V A P R O G R A M M I N G 1 4 3 . 2 . 1 T H E A C C O U N T O F T H E H I S T O R Y O F J A V A 1 5 3.3 A P P L E T 1 8 3 . 3 . 1 A P P L E T D O 1 9 3 . 3 . 2 T H E B A S I C A P P L E T L I F E C Y C L E 1 9 3 . 4 W H Y U S I N G J A V A P R O G R A M M I N G ? 2 1 3 . 5 L I M I T A T I O N S O F T H E J A V A P R O G R A M M I N G 2 4 3.6 S U M M A R Y 2 5 > CHAPTER - 04 INTRODUCTION TO THE NETWORK MODELS 4 . 1 I N T R O D U C T I O N T O D I J I K S T R A M O D E L 2 7 4 . 1 . 1 F O R M A L N O T A T I O N O F T H E A L G O R I T H A M 2 9 4 . 1 . 2 E X A M P L E O F T H E A L G O R I T H A M IN A C T I O N 3 1 4 . 1 . 3 M A N U A L D I J K S T R A C A L C U L A T I O N 3 3 4.2 I N T R O D U C T I O N T O P R I M N E T W O R K M O D E L 3 6 4 . 2 . 2 F O R M A L N O T A T I O N O F T H E A L G O R I T H A M 3 7 4 . 3 I N T R O D U C T I O N T O K R U S K A L ' S M O D E L 4 2 4 . 3 . 1 F O R M A L N O T A T I O N O F T H E A L G O R I T H A M 4 3 4.4 S U M M A R Y 4 5 CHAPTER - 05 METHODOLOGY 5 . 1 I N T R O D U C T I O N 4 7 5 . 2 ENTITY R E L A T I O N S H I P D I A G R A M 4 9 5 . 3 ENTITY A T T R I B U T E D E S C R I P T I O N 5 0 5.4 C O N T E X T D I A G R A M 5 1 5.5 S U M M A R Y 5 7 CHAPTER - 06 THE PROTOTYPE SYSTEM 6.1 I N T R O D U C T I O N 5 9 6 . 2 T O O L S U S E D 5 9 6 . 3 S T R U C T U R E O F T H E P R O T O T Y P E S Y S T E M 6 1 6 . 4 S U M M A R Y 6 3 / ^ CHAPTER - 07 pf^ OUTPUTS OF THE PROTOTYPE SYSTEM V 7 . 1 I N T R O D U C T I O N 6 5 7 . 2 D I J I K S T R A N E T W O R K M O D E L P A G E L A Y O U T S 6 5 7 . 3 P R I M N E T W O R K M O D E L P A G E L A Y O U T S 6 6 7 . 4 K R U S K A L N E T W O R K M O D E L P A G E L A Y O U T S 6 7 7 . 5 O U T P U T S O F T H E P R I M N E T W O R K M O D E L 6 8 7 . 5 O U T P U T S O F T H E K R U S K A L ' S M O D E L 7 1 7.6 S U M M A R Y 7 5 vii CHAPTER - 0 8 TESTING 8 . 1 T E S T I N G 7 6 CHAPTER - 0 9 CONCLUSION 9 . 1 A C H I E V E M E N T S O F AIM A N D O B J E C T I V E S 8 2 9 . 2 P R O B L E M E N C O U N T E R E D 8 4 9 . 3 F U T U R E E N H A N C E M E N T S 8 4 REFERENCE 8 7 APPENDIX - A 9 1 APPENDIX - B 118 A P P E N D I X - C 133 > viii L I S T O F F I G U R E S FIGURE PAGE NUMBER 1. Manual Dijkstra Network Model calculation example 33 2. Manual Prim Network Model calculation example 39 3. Manual Kruskal Network Mode l calculation example 45 4. Structure diagram 47 5. Entity relationship diagram 49 6. Context diagram 51 7. First level diagram 52 8. D.F.D process 1.0 53 9. D.F.D process 1.2 54 10. D.F.D process 2.0 54 11. D .F .D process 3.0 55 12. D.F.D process 3.2 56 13. D .F .D process 4.0 56 14. Structure o f the prototype system 61 15. Future improvement menu map 85 ix