- Questions & Answers
- Accounting
- Computer Science
- Automata or Computationing
- Computer Architecture
- Computer Graphics and Multimedia Applications
- Computer Network Security
- Data Structures
- Database Management System
- Design and Analysis of Algorithms
- Information Technology
- Linux Environment
- Networking
- Operating System
- Software Engineering
- Big Data
- Android
- iOS
- Matlab

- Economics
- Engineering
- Finance
- Thesis
- Management
- Science/Math
- Statistics
- Writing
- Dissertations
- Essays
- Programming
- Healthcare
- Law

- Log in | Sign up

Programming in C

A5.dvi School of Computer Science University of Guelph CIS*3490 The Analysis and Design of Algorithms Winter 2023 Instructor: Fangju Wang Assignment 5 (100%) For this assignment, you are required to write programs in C. No pseudocode. Question 1: Subset-Sum Problem (50%) The subset-sum problem is to find a subset of a given set A = {a1, a2, ..., an} of n positive integers, such that the subset’s sum is equal to a given positive integer d. For example, for A = {1, 2, 5, 6, 8} and d = 9, there are two subsets {1, 2, 6} and {1, 8} whose sums are equal to 9 . Write the following programs for finding the number of the subsets whose sums are equal to a given positive integer d. In the above example, the number is 2. 1.1 A program to implement a brute force (exhaustive search) algorithm (15%) 1.2 A possibly more efficient program based on the backtracking technique (35%) Requirements: When a program is executed, it prompts for a file name and a positive integer d, reads in the file containing the set A, and computes and reports the number of the subsets whose sums are equal to d. The program for 1.1 is also required to report the number of all the subsets evaluated. The program for 1.2 is also required to report the number of the dead ends. The programs are not required to list the subsets. A program is required to report the running time for finding the subsets. The running time should not include the time for reading the file. You can use file data A5 Q1 1.txt to develop/test your programs. This file contains 25 integers. A different data file will be used to grade your programs. The numbers of integers and data formats of the two data files will be the same. Question 2: Person-Job Assignment Problem (50%) In an assignment problem, there are n people who need to be assigned to execute n jobs, one person per job. Each person is assigned to exactly one job and each job is assigned to exactly one person. A person creates a value in doing a job. In this assignment problem, V [i.j] in the n × n matrix V stores the value created by person i in doing job j (i, j = 1, 2, ...n). The problem is to find a person-job assignment that maximizes the total value. 1 Write the following programs to solve the assignment problem with a given V . 2.1 A program to implement a brute force (exhaustive search) algorithm (15%) 2.2 A possibly more efficient program based on the branch-and-bound technique (35%) Requirements: When a program is executed, it prompts for a file name, reads in the file containing matrix V , and computes and reports the assignment and the total value created. Please see the guide for the format for reporting and assignment. The program for 2.1 is also required to report the number of all the assignments evaluated. The program for 2.2 is also required to report the maximum upper bound in each step. A program is required to report the running time for finding the assignment. The running time should not include the time for reading the file. You can use file data A5 Q2 1.txt to develop/test your programs. This file contains a 12 × 12 matrix, for 12 persons and 12 jobs. A different data file will be used to grade your programs. The numbers of integers and data formats of the two data files will be the same. Note: Write your own code for this assignment. NO code from any source is allowed. Due time: 08:00am, Monday April 10, 2023. Submit your work as a tar or zip file to Moodle. 2

A5.dvi School of Computer Science University of Guelph CIS*3490 The Analysis and Design of Algorithms Winter 2023 Instructor: Fangju Wang Assignment 5 (100%) For this assignment, you are required to write programs in C. No pseudocode. Question 1: Subset-Sum Problem (50%) The subset-sum problem is to find a subset of a given set A = {a1, a2, ..., an} of n positive integers, such that the subset’s sum is equal to a given positive integer d. For example, for A = {1, 2, 5, 6, 8} and d = 9, there are two subsets {1, 2, 6} and {1, 8} whose sums are equal to 9 . Write the following programs for finding the number of the subsets whose sums are equal to a given positive integer d. In the above example, the number is 2. 1.1 A program to implement a brute force (exhaustive search) algorithm (15%) 1.2 A possibly more efficient program based on the backtracking technique (35%) Requirements: When a program is executed, it prompts for a file name and a positive integer d, reads in the file containing the set A, and computes and reports the number of the subsets whose sums are equal to d. The program for 1.1 is also required to report the number of all the subsets evaluated. The program for 1.2 is also required to report the number of the dead ends. The programs are not required to list the subsets. A program is required to report the running time for finding the subsets. The running time should not include the time for reading the file. You can use file data A5 Q1 1.txt to develop/test your programs. This file contains 25 integers. A different data file will be used to grade your programs. The numbers of integers and data formats of the two data files will be the same. Question 2: Person-Job Assignment Problem (50%) In an assignment problem, there are n people who need to be assigned to execute n jobs, one person per job. Each person is assigned to exactly one job and each job is assigned to exactly one person. A person creates a value in doing a job. In this assignment problem, V [i.j] in the n × n matrix V stores the value created by person i in doing job j (i, j = 1, 2, ...n). The problem is to find a person-job assignment that maximizes the total value. 1 Write the following programs to solve the assignment problem with a given V . 2.1 A program to implement a brute force (exhaustive search) algorithm (15%) 2.2 A possibly more efficient program based on the branch-and-bound technique (35%) Requirements: When a program is executed, it prompts for a file name, reads in the file containing matrix V , and computes and reports the assignment and the total value created. Please see the guide for the format for reporting and assignment. The program for 2.1 is also required to report the number of all the assignments evaluated. The program for 2.2 is also required to report the maximum upper bound in each step. A program is required to report the running time for finding the assignment. The running time should not include the time for reading the file. You can use file data A5 Q2 1.txt to develop/test your programs. This file contains a 12 × 12 matrix, for 12 persons and 12 jobs. A different data file will be used to grade your programs. The numbers of integers and data formats of the two data files will be the same. Note: Write your own code for this assignment. NO code from any source is allowed. Due time: 08:00am, Monday April 10, 2023. Submit your work as a tar or zip file to Moodle. 2

Mar 30, 2023

SOLUTION.PDF## Get Answer To This Question

- Use C to finish the assignment, more information is in Readme. md. And check the code similaritySolvedMay 25, 2023
- antt chart appropriate to the projectHigh level Project Design with diagram 2Project design prototype: Project with block diagramsstep by step (you can use UML/Use cases/flow 5charts)Budget...SolvedMay 16, 2023
- MIS 312 Week 5 AssignmentSetup for the Assignment: This week’s reading is drawing your focus on how to refine your user story telling skills and then how to start thinking about how to use UI...SolvedMay 02, 2023
- the question is in the assignment please keep the answer as simple as possibleSolvedApr 27, 2023
- Working with ColorV I S U A L M E D I A D E S I G N 10 5COLOR ESSENTIALSColors can be specified in InDesign according to three different color models:PROCESS COLORS This is the color...SolvedApr 26, 2023
- CHECK FILES BELOW..... WOULD NEED THE EXPERT WHO WORKED ON ORDER118761TO WORK ON THIS ONE AS ALL ASSIGNMENTS ARE RELATED TO EACH OTHER. THE EXPERT HAS A COPY OF THE PDF E-BOOK. IF NOT, I WILL PROVIDE...SolvedApr 24, 2023
- SQL project 3 and project 4. Would like to get it completed in my LAB worksheet which means the expect needs to login into my student account and complete it. thanksSolvedApr 23, 2023
- Project3: Analysis of the Amazon co-purchasing data.Provided data:Amazon co-purchasing data is stored here:http://snap.stanford.edu/data/amazon-meta.htmlGoal:1) Visualize the data (like...SolvedApr 17, 2023
- This assignment is focused on machine learning, mainly on the implementation of 2 different algorithms - Stochastic Gradient Descent & ID3 decision tree. The assignment is divided into two sections,...SolvedApr 16, 2023
- A Predictive Model for Diagnosis in BiomedicineGroup Number: 7Group members: 3Motivation: To provide clinicians with a fast and accurate diagnostic tool that can aid in early detection and...SolvedApr 15, 2023

Copy and Paste Your Assignment Here

Copyright © 2023. All rights reserved.