CCS592 Advanced Algorithms and Complexity [Algoritma Lanjutan & Kekompleksan]

Similar documents
UNIVERSITI SAINS MALAYSIA. CST331 Principles of Parallel & Distributed Programming [Prinsip Pengaturcaraan Selari & Teragih]

UNIVERSITI SAINS MALAYSIA. CPT344 Computer Vision & Image Processing [Penglihatan Komputer & Pemprosesan Imej]

UNIVERSITI SAINS MALAYSIA. CCS592 Advanced Algorithms and Complexity [Algoritma Lanjutan & Kekompleksan]

UNIVERSITI SAINS MALAYSIA. CPT113 Programming Methodology & Data Structures [Metodologi Pengaturcaraan & Struktur Data]

UNIVERSITI SAINS MALAYSIA. CST333 Distributed & Grid Computing [Perkomputeran Teragih & Grid]

CPT212 Design & Analysis of Algorithms [Reka Bentuk & Analisis Algoritma]

UNIVERSITI SAINS MALAYSIA. CST232 Operating Systems [Sistem Pengendalian]

UNIVERSITI SAINS MALAYSIA. CMT322/CMM323 Web Engineering & Technologies [Kejuruteraan & Teknologi Web]

UNIVERSITI SAINS MALAYSIA. CST332 Internet Protocols. Architecture & Routing [Protokol, Seni Bina & Penghalaan Internet]

UNIVERSITI SAINS MALAYSIA. CCS522 Advanced Data Communication & Computer Networks [Rangkaian Komputer & Komunikasi Data Lanjutan]

MSS 317 Coding Theory [Teori Pengekodan]

UNIVERSITI SAINS MALAYSIA. CPT212 Design & Analysis of Algorithms [Reka Bentuk & Analisis Algoritma]

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

UNIVERSITI SAINS MALAYSIA. CPT111/CPM111 Principles of Programming [Prinsip Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CCS521 Advanced Distributed Systems Concepts and Design [Konsep dan Reka Bentuk Sistem Teragih Maju]

UNIVERSITI SAINS MALAYSIA

UNIVERSITI SAINS MALAYSIA. CCS522 Advanced Data Communication and Computer Networks [Rangkaian Komputer dan Komunikasi Data Lanjutan]

MSS 318 Discrete Mathematics [Matematik Diskret]

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

UNIVERSITI SAINS MALAYSIA. CST334 Network Monitoring & Security [Pengawasan & Keselamatan Rangkaian]

UNIVERSITI SAINS MALAYSIA. CMT324 Computer Graphics & Visual Computing [Grafik Komputer & Perkomputeran Visual]

UNIVERSITI SAINS MALAYSIA. CPT211-CPM313 Programming Language Concepts & Paradigm [Konsep & Paradigma Bahasa Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. Peperiksaan Semester Pertama Sidang Akademik 2003/2004. September/Oktober 2003

UNIVERSITI SAINS MALAYSIA. CST331 Principles of Parallel & Distributed Programming [Prinsip Pengaturcaraan Selari & Teragih]

Lab 4 : Sorting Techniques

...a- JEE ELEKTRONIK DIGIT II. UNlVERSlTl SAINS MALAYSIA. Peperiksaan Semester Kedua Sidang Akademik FebruarVMac 2003.

CPT211/CPM313 Programming Language Concepts & Paradigms [Konsep & Paradigma Bahasa Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CMT422 Multimedia Information Systems & Management [Sistem & Pengurusan Maklumat Multimedia]

EEE 348 PENGANTAR REKABENTUK LITAR BERSEPADU

EEE 428 SISTEM KOMPUTER

UNIVERSITI SAINS MALAYSIA. CST131 Computer Organisation [Organisasi Komputer]

ssk 2023 asas komunikasi dan rangkaian TOPIK 4.0 PENGALAMATAN RANGKAIAN Minggu 11

UNIVERSITI SAINS MALAYSIA. CPT103/ CPM211 Struktur Data & Paradigma Pengaturcaraan

UNIVERSITI SAINS MALAYSIA. CCS513 Computer Vision and Image Analysis [Penglihatan Komputer dan Analisis Imej]

CPT111/CPM111 Principles of Programming [Prinsip Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CMT224/CMM221 Multimedia Systems [Sistem Multimedia]

UNIVERSITI SAINS MALAYSIA. CPT111 Principles of Programming [Prinsip Pengaturcaraan]

UNIVERSITI SAINS MALAYSIA. CPT103/CPM211 Struktur Data & Paradigma Pengaturcaraan

COMBINING TABLES. Akademi Audit Negara. CAATs ASAS ACL / 1

UNIVERSITI SAINS MALAYSIA. CST234 Network Programming [Pengaturcaraan Rangkaian]

UNIVERSITI SAINS MALAYSIA. CST231/CSM331 Data Communications & Networks [Komunikasi Data & Rangkaian]

UNIVERSITI SAINS MALAYSIA. CPT103 Struktur Data & Paradigma Pengaturcaraan

INSTRUCTION: This section consists of FOUR (4) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi EMPAT (4) soalan. Jawab SEMUA soalan.

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

UNIVERSITI SAINS MALAYSIA. CPT341 Software Design & Architecture [Reka Bentuk & Seni Bina Perisian]

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

MAT 181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

MAT181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

EEE 355 ROBOTIC & AUTOMATION [Robotik & Pengautomatan]

EEE348 INTRODUCTION TO INTEGRATED CIRCUIT DESIGN (PENGANTAR REKABENTUK LITAR BERSEPADU)

MAT 181 Programming for Scientific Applications [Pengaturcaraan untuk Penggunaan Sains]

INSTRUCTION: This section consists of TWO (2) short answer and structured essay questions. Answer ALL questions.

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

Pengenalan Sistem Maklumat Dalam Pendidikan

PART A SULIT (EKT 221) BAHAGIAN A. Answer ALL questions. Question 1. a) Briefly explain the concept of Clock Gating.

EEM 312 ROBOTIK & PENGLIHATAN MESIN

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

UNIVERSITI SAINS MALAYSIA. CCS523 Computer Security & Cryptography [Keselamatan Komputer & Kriptografi]

UNIVERSITI SAINS MALAYSIA. CST232 Operating Systems [Sistem Pengendalian]

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

PANDUAN PENGGUNA (PENTADBIR SYSTEM/SYSTEM ADMINISTRATOR) (INFOTECH, BPPF DAN POLIS

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

Pengguna akan diberikan Username dan Password oleh Administrator untuk login sebagai admin/conference Manager bagi conference yang akan diadakan.

MAT 181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

Panduan Menggunakan Autoresponder FreeAutobot.com

UNIVERSITI SAINS MALAYSIA. CPT201 Reka Bentuk & Analisis Algoritma

INSTRUCTION: This section consists of TWO (2) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi DUA (2) soalan. Jawab SEMUA soalan.

UNIVERSITI SAINS MALAYSIA. CPT101 Prinsip-Prinsip Pengaturcaraan

INSTRUCTION: This section consists of TWO (2)short answers and TWO (2) structured essays. Answer ALL questions.

UNIVERSITI SAINS MALAYSIA. CST432 Microprocessors & Embedded Systems [Mikropemproses & Sistem Terbenam]

Registration of Supplier (ROS) TM Supplier Registration Renewal via SUS Portal (Pembaharuan Pendaftaran Pembekal TM melalui SUS Portal)

MANAGE COURSE RESOURCES LABEL TEXT PAGE URL BOOK FILE FOLDER IMS CONTENT PACKAGE

Semasa buku ini ditulis XAMPP mengandungi empat versi:

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

INSTRUCTION: This section consists of TEN (10) structured questions. Answer ALL questions.

UNIVERSITI SAINS MALAYSIA. CCS514 - Envisioning Information [Pemelihatan Maklumat]

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

AN ENHANCED SIMULATED ANNEALING APPROACH FOR CYLINDRICAL, RECTANGULAR MESH, AND SEMI-DIAGONAL TORUS NETWORK TOPOLOGIES NORAZIAH BINTI ADZHAR

PANDUAN PENGGUNA (SUPPLIER) e-purchase ORDER FOR SERVICES

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

PANDUAN PENGGUNA (SUPPLIER) MAINTAIN CERTIFICATES/SUPPLIER DETAILS SUPPLIER RELATIONSHIP MANAGEMENT SUPPLY CHAIN MANAGEMENT SYSTEM (SCMS)

PANDUAN PENGGUNA (PENSYARAH)

UNIVERSITI SAINS MALAYSIA. CCS523 Computer Security & Cryptography [Keselamatan Komputer & Kriptografi]

CST432 Microprocessors & Embedded Systems [Mikropemproses & Sistem Terbenam]

MAT 181 Programming For Scientific Applications [Pengaturcaraan Untuk Penggunaan Sains]

INSTRUCTION: This section consists of TWO (2) questions. Answer ALL questions. ARAHAN: Bahagian ini mengandungi DUA (2) soalan. Jawab SEMUA soalan.

MICROSOFT EXCEL. Membina Hamparan Elektronik Fungsi Hamparan Elektronik

PANDUAN PENGGUNA (SUPPLIER) MAINTAIN CERTIFICATES/SUPPLIER DETAILS SUPPLIER RELATIONSHIP MANAGEMENT SUPPLY CHAIN MANAGEMENT SYSTEM (SCMS)

Panduan Guru Maker UNO/ Arduino

Registration of Supplier (ROS) TM Supplier Registration Renewal via SUS Portal (Pembaharuan Pendaftaran Pembekal TM melalui SUS Portal)

FIRST TIME LOGIN & SELF REGISTRATION USER GUIDE LOG MASUK KALI PERTAMA & PENDAFTARAN SENDIRI PANDUAN PENGGUNA

INSTRUCTION: This section consists of TWO (2) structured questions. Answer ALL questions.

UNIVERSITI SAINS MALAYSIA EEE 355 ROBOT DAN PENGAUTOMATAN

CST234 Network Programming [Pengaturcaraan Rangkaian]

DOKUMEN TIDAK TERKAWAL

UNIVERSITI SAINS MALAYSIA. CST431/CST335 Systems Security & Protection [Keselamatan & Perlindungan Sistem]

INSTRUCTION: This section consists of FOUR (4) structured questions. Answer ALL questions.

TEKNOLOGI, GADJET & KEIBUBAPAAN

BORANG PENCALONAN HADIAH UNIVERSITI NOMINATION FORM FOR UNIVERSITY AWARD

Transcription:

Second Semester Examination 2016/2017 Academic Session June 2017 CCS592 Advanced Algorithms and Complexity [Algoritma Lanutan & Kekompleksan] Duration : 2 hours [Masa : 2 am] INSTRUCTIONS TO CANDIDATE: [ARAHAN KEPADA CALON:] Please ensure that this examination paper contains FOUR questions in NINE printed pages before you begin the examination. [Sila pastikan bahawa kertas peperiksaan ini mengandungi EMPAT soalan di dalam SEMBILAN muka surat yang bercetak sebelum anda memulakan peperiksaan ini.] Answer ALL questions. [Jawab SEMUA soalan.] You may answer the questions either in English or in Bahasa Malaysia. [Anda dibenarkan menawab soalan sama ada dalam bahasa Inggeris atau bahasa Malaysia.] In the event of any discrepancies, the English version shall be used. [Sekiranya terdapat sebarang percanggahan pada soalan peperiksaan, versi bahasa Inggeris hendaklah diguna pakai.]...2/-

- 2-1. The travelling salesperson problem (TSP) asks the following question: "Given a list of n cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?" Masalah peralanan uruual (MPJ) bertanya soalan berikut: "Diberi suatu senarai n bandar dan arak di antara setiap pasangan bandar-bandar, apakah laluan yang paling singkat yang akan melawat setiap bandar sekali sahaa dan kembali ke bandar asal?" (a) A naïve/straightforward algorithm can be implemented to find out all the combinations of routes in a TSP, and then the shortest route can be chosen. Algoritma naif/mudah boleh dilaksanakan untuk mencari semua kombinasi laluan dalam MPJ, dan laluan paling dekat boleh dipilih. What are two (2) main primitive operations used in the algorithm. Apakah dua (2) operasi primitif yang digunakan dalam algoritma tersebut? What is the time complexity of the naïve algorithm? Describe how you get the answer. Apakah kekompleksan masa algoritma naif berkenaan? Terangkan bagaimana anda mendapat awapan tersebut. (15/100) (b) One possible approach to be applied on TSP is using the greedy algorithm. Salah satu pendekatan yang mungkin digunakan pada MPJ ialah menggunakan algoritma tamak. What is greedy algorithm? Apa itu algoritma tamak? Describe a greedy algorithm that can give a reasonable good solution to TSP. Use a figure to help you to explain the algorithm. Terangkan algoritma tamak yang boleh memberikan penyelesaian yang munasabah kepada MPJ. Gunakan gambar raah bagi membantu anda menelaskan algoritma tersebut. What is the time complexity of the algorithm? Describe how you get the answer. Apakah kekompleksan masa algoritma tersebut? Terangkan bagaimana anda mendapat awapan tersebut. (35/100)...3/-

- 3 - (c) Another way to solve TSP is using convex hull algorithm. Cara lain untuk menyelesaikan MPJ ialah menggunakan algoritma hul cembung. Describe the convex hull algorithm. Use a figure to help you to explain the algorithm. Terangkan algoritma hul cembung. Gunakan gambar raah untuk membantu anda untuk menerangkan algoritma tersebut. What is the heuristic/assumption made when using convex hull algorithm to solve TSP? Apakah heuristik/andaian yang dibuat apabila menggunakan algoritma hul cembung untuk menyelesaikan MPJ? Explain the modification required on the convex hull algorithm to solve the TSP. Terangkan pengubahsuaian yang diperlukan pada algoritma hul cembung untuk menyelesaikan MPJ. (iv) What is the time complexity of the new algorithm? Describe how you get the answer. Apakah kekompleksan masa algoritma hul cembung? Terangkan bagaimana anda mendapat awapan tersebut. (50/100) 2. The maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers which has the largest sum. For example, for the sequence of values 2, 1, 3, 4, 1, 2, 1, 5, 4; the contiguous subarray with the largest sum is 4, 1, 2, 1, with sum 6. Masalah sub tatasusunan maksimum ialah masalah mencari sub tatasusuan berdampingan dalam suatu tatasusunan satu dimensi nombor yang mempunyai umlah nilai terbesar. Sebagai contoh, untuk urutan nilai -2, 1, -3, 4, -1, 2, 1, -5, 4; sub tatasusunan berdampingan dengan umlah terbesar ialah 4, -1, 2, 1, dengan umlah 6. (a) Could you suggest one possible area where the algorithm to solve the maximum subarray problem can be applied? Bolehkah anda cadangkan satu bidang yang mungkin di mana algoritma untuk menyelesaikan masalah sub tatasusunan maksimum boleh digunakan? (20/100)...4/-

- 4 - (b) If we simply write a naïve/straight forward algorithm to find the maximum subarray. Jika kita hanya menulis algoritma naif/mudah untuk mencari sub tatasusunan maksimum. What are the two (2) main primitive operations used in the algorithm? Apakah dua (2) operasi primitif utama yang digunakan dalam algoritma tersebut? Describe the naive algorithm. Terangkan algoritma naif tersebut. What is the complexity of the algorithm? Apakah kekompleksan algoritma tersebut? (40/100) (c) A more efficient approach is to use dynamic programming to solve the problem. Pendekatan yang lebih cekap adalah dengan menggunakan pengaturcaraan dinamik untuk menyelesaikan masalah tersebut. Explain how dynamic programming achieves the computational efficiency. Terangkan bagaimana pengaturcaraan dinamik mencapai kecekapan pengiraan. Describe an algorithm using dynamic programming to solve the maximum subarray problem. Use figure to explain the algorithm. Terangkan suatu algoritma menggunakan pengaturcaraan dinamik untuk menyelesaikan masalah sub tatasusunan maksimum. Gunakan gambar raah untuk menelaskan algoritma tersebut. What is the complexity of the algorithm? Apakah kekompleksan algoritma tersebut? (40/100)...5/-

- 5-3. (a) Based on the graph below, by only deleting edge(s) (delete as minimum as possible): Berdasarkan graf di bawah, dengan hanya menghapuskan tepi(-tepi) (hapuskan seminimum yang mungkin): 0 1 5 2 4 3 Make it a disconnected graph. Jadikannya sebuah graf tak terkait. Make it a bipartite graph. Jadikannya sebuah graf dwipihak. Make it a planar graph. Jadikannya sebuah graf sesatah. (iv) Create a subgraph of the graph. Cipta sebuah subgraf bagi graf berkenaan. (v) Create a spanning subgraph of the graph. Cipta sebuah subgraf rentang bagi graf berkenaan. (25/100)...6/-

- 6 - (b) Given below is the pseudocode for finding the minimum spanning tree based on the Kruskal s algorithm. Diberikan di bawah pseudokod untuk mencari pepohon rentang minimum berdasarkan algoritma Kruskal. 1 procedure Kruskal(G, w, MCSTree) 2 Sort the edges in non-decreasing order of weight w(e 1 ) < < w(e m ) 3 Forest 4 Size 0 5 for i 0 to n-1 do Parent[i] -1 6 endfor 7 0 8 while Size < n 1.and. < m do 9 +1 10 Find2(Parent[0:n-1], u, r) // e =u v 11 Find2(Parent[0:n-1], v, s) 12 if r s then //add edge e to Forest 13 Forest Forest U {e } 14 Size Size +1 15 Union(Parent[0:n-1], r, s) // combine sets containing u andv 16 endif 17 endwhile 18 MCSTree Forest 19 end Kruskal Is this algorithm considered to be a greedy method? Explain. Adakah algoritma ini dianggap sebagai kaedah tamak? Jelaskan. What is the role of Find2 in the above pseudocode (Lines 10 and 11)? Apakah peranan Find2 dalam pseudokod di atas (Baris 10 dan 11)? Based on the pseudo-code above, state the complexity of this algorithm and indicate which part of the pseudocode actually contributes to this complexity. Berdasarkan pseudokod di atas, nyatakan kekompleksan algoritma ini dan tunukkan bahagian manakah dalam pseudokod berkenaan yang sebenarnya menyumbang kepada kekompleksan ini....7/-

- 7 - (iv) Trace step by step how the algorithm works on the following graph. Surih langkah demi langkah bagaimana algoritma berkenaan dilaksanakan ke atas graf berikut. 0 3 1 2 3 4 8 6 2 9 4 (45/100) (c) Define articulation point formally and explain its importance in a communication network. Takrifkan titik artikulasi secara formal dan huraikan kepentingannya dalam rangkaian komunikasi. Obtain articulation point(s) of the following graph. Dapatkan titik(-titik) artikulasi bagi graf berikut. 3 7 2 6 1 4 5 Obtain bi-connected component(s) of the graph in Question 3(c) based on the articulation point(s) that you have obtained in that question. Dapatkan komponen(-komponen) bagi graf dalam Soalan 2(c) berdasarkan titik(-titik) yang anda telah dapat dalam soalan berkenaan. (30/100)...8/-

- 8-4. (a) Given the following pseudocode for the naive string-matching algorithm: Diberi pseudokod berikut untuk algoritma pemadanan rentetan naif: 1 function NaiveStringMatcher(P[0:m-1],T[0:n-1]) 2 P[0:m-1] // a pattern string of length m 3 T[0:n-1] // a text string of length n 4 for s 0 to n-m do 5 if T[s : s + m 1] = P then 6 return (s) 7 endif 8 endfor 9 return(-1) 10 end NaiveStringMatcher Explain the role of line 5 in the above pseudocode. Huraikan peranan baris 3 dalam pseudokod di atas. Obtain that best-case and worst-case complexities of the algorithm based on for loop (lines 4-8). Dapatkan kekompleksan kes terbaik dan kes terburuk algoritma berkenaan berdasarkan gelung for (baris 4-18). Give examples of P and T that will give the worst-case complexity. Beri contoh P dan T yang akan memberikan kekompleksan kes terbaik. (iv) Compare and contrast algorithmically and in terms of complexity, this algorithm with the Knuth-Morris-Pratt Algorithm string-matching algorithm. Banding dan bezakan dari segi algoritma dan kekompleksan, algoritma ini dengan algoritma pemadanan rentetan Knuth-Morris-Pratt. (50/100) (b) Without going into mathematical detail or writing any code, explain how divideand-conquer strategy is used in the Fast Fourier Transform and how this strategy yields O(n log n) complexity. Tanpa perincian matematik atau menulis kod, huraikan bagaimana strategi bahagi-dan-tawan digunakan dalam Jelmaan Cepat Fourier dan bagaimana strategi ini menghasilkan kekompleksan O(n log n). (25/100)...9/-

- 9 - (c) How is a digraph used in ranking of web pages in the page rank algorithm? Also, explain how the web pages are organised as a digraph. Bagaimanakah graf berarah digunakan dalam pemeringkatan halaman web dalam algoritma taraf halaman? Juga, huraikan bagaimana halamanhalaman web berkenaan disusun sebagai sebuah graf berarah. The PageRank, R[p] has an interesting interpretation in terms of random walk. B can be thought of as the matrix for a random walk on diagraph W, where B[p,q] is the probability that a random walker at page p ( aimless surfer ) will follow the hyperlink from page p to page q. How does this concept of aimless surfer provide a meaningful interpretation of ranking of Web pages? Peringkat Halaman, R[p] mempunyai penafsiran yang menarik dari segi peralanan rawak. B boleh dianggap sebagai matriks untuk sebuah peralanan rawak ke atas graf berarah W, dan B[p,q] adalah kebarangkalian seseorang pealan rawak di halaman p ( pelayar tak bertuuan ) akan melalui pautan hiper dari halaman p ke halaman q. Bagaimanakah konsep pelayar tak bertuuan ini memberikan penafsiran yang bermakna dalam pemeringkatan laman web? (25/100) - ooooooo -