4 views

Uploaded by Mayisha Fabliha

comp 208

save

- MATRIX ALGEBRA with MATHEMATICA.pdf
- LeBlender_0.9.x
- Scilab_beginners.pdf
- Result CCA Arboretum
- R.programming Online Training In Hyderabad
- Computer Science - Syl
- Tata Consultancy Services
- rref
- I YEAR
- WAVELET_PSO-BASED_LQR_ALGORITHM_FOR_OPTI.pdf
- NEW Curriculum. Chemical 2006-1
- Www.mathworks.com Support Tech-notes 1200 1207
- Functions and Data Structures
- Ft Sem 1 New Syllabus 12
- Untitled
- FR200
- #!MACDonchart
- path h
- Msqe Pea 2016
- Basic Matlab
- Lab Four 1133
- 1-s2.0-0020740372900410-main
- 08_Formulas and Objects
- The Ring programming language version 1.5.3 book - Part 72 of 184
- Is Economic Calculation Hyper Computational?
- Reporting Point Backflush in REM Process
- (1)
- IFAC2005lin
- Mathematical Model and Six-Degree-Of-Freedom Simulation of Two Business Jet Aircraft
- Assignment Problem
- WHMIS LabVersion Aug2012 %5b4 Pages%5d
- DAN 6 Example
- Final Infographic
- Fundamentals of Aerodynamics - John D. Anderson, Jr. - Insructor's Solution Manual
- Conformal
- Midterm 2 F09
- MECH 383-Lab 1
- Fluids Report
- MATH317 Notes After Midterm
- Dyna Mech Crib Sheet
- midterm 2
- Midterm 2 F09
- solution manual for manufacturing
- Lecture 10 - Abrasive Machining and Finishing Operation-W15
- ocr_7770_sam_gce_unit_f325
- 6106_03_msc_20090206
- Lecture 9 - CNC Technology and Economics of Machining-W15
- 39978500-Ch7
- Chap 5
- MECH 383-Lab 1
- Inertia
- Chap 5
- This Preparation Produces Ethanal in Aqueous Solution
- 1.2 How Does the CLS Synch Rot Ron Work

You are on page 1of 3

Due Date

Assignment 3 is due on Friday, February 22 at midnight. The cutoff is automated and is exactly at this time. Assignments submitted within the next hour will be considered late. After that time they will not be accepted at all. The assignment is to be done individually. You can collaborate on understanding the problem but you must write the solutions independently. Submissions might be subject to being checked by plagiarism detection software.

Introduction

On a social network site (Facebook, LinkedIn, etc..) pairs of people can be friends. If Alice is friends with Bob and Carol and David is also friends with Bob and Carol, then Alice and David have two mutual friends. If Alice and David are not friends, the site might suggest to each of them that they might want to become friends (since they have at least two mutual friends). The purpose of this assignment is to examine the set of friends in a social network and discover pairs of people who are not friends but have mutual friends.

Assignment

Your program should read a file containing a description of a social network. It should then output a list of suggested new friends for each pair of members of the network who have the most mutual friends.

Analysis

Suppose the social network has n members. The set of friends can be represented by an n by n two dimensional matrix. The entry F(i,j) equals 0 if member i and member j are not friends and equals 1 if they are friends. We also require that the diagonal elements (F(i, i)) be equal to 0 since a person cannot be friends with him or herself in the network. We note that the matrix is symmetric since if members i and j are friends, then F(i,j) = F(j,i) = 1.

You will be provided with more sets of data on MyCourses for testing your program. the non-zero terms will be exactly those terms where F(i. given an n by n matrix. 5 or more than 5 mutual friends. Step 3: Define a subroutine which. followed by n lines which describe the “friends” of the corresponding member. It should output the results of this search.f90) and name your file A3_123456789 where 1234567898 is replaced by your student ID number. That means that members i and j have member k as a mutual friend. the top non-zero entry is the one with 3 mutual friends. counts the number of how many members have 0.j) are both 1. The matrix is symmetric so F2(i. Be careful not to double-count pairs of members.Now consider the result of multiplying F by itself to produce the matrix F2. For this sample data your program should output “suggested friends” for members are not already friends and have 2 or 3 mutual friends. Step 2: Define a subroutine to compute the product of two square n by n matrices. the sum counts the number of mutual friends that i and j have. In the sample data there is only one pair with 3 mutual friends but several with 2 mutual friends. 1. say F. Step 4: Output a list of “suggested friends”. do not output the same pair twice. Also be careful not to count the diagonal entries since a member cannot be friends with him or herself. Your program should use this subroutine to multiply the “friends” array by itself and produce the array F2. The subroutine should generate and return an array of length 7 with the counts for each category. Your program should use this subroutine to determine how interconnected the social network is. . Use meaningful variable names Comment and indent your code. In the sum. n. Your program should not make assumptions about the size of the data set other than to assume a maximum size such as 1000. The file will consist of a line with the number of members of the array. It is your responsibility to make it readable to the grader Submit only the source file (.i) will have the same values but should only be counted once. 2. In short. In the sample data provided below. The suggested friends are those in the top two non-zero categories. 3. Methodology Step 1: Read a data file describing a social network into a two dimensional array. Again.j) and F2(j.k) and F(k. Requirements The programs must be written in Fortran Define and use the subroutines as described above. The values in this matrix are defined (using matrix multiplication) as . 4. A sample of data for a network with 27 members is provided below.

Sample Data 27 000000000000000000000010000 000000000001000000000000000 000000000001000000100001000 000000000000000010100000000 000000001001100000000000000 000000000100000000000000101 000000001010001010100010001 000000000000000000000000100 000010100010000000101100010 000001000001100000001000000 000000101000000000000000000 011010000100000000000000000 000010000100010010001001000 000000000000101100000000010 000000100000010000000001000 000000000000010000000000000 000100100000100001010000100 000000000000000010000001000 001100101000000000000001100 000000000000000010001000000 000000001100100000010010001 000000001000000000000000100 100000100000000000001000000 001000000000101001100000000 000001010000000010100100000 000000001000010000000000000 000001100000000000001000000 .

- MATRIX ALGEBRA with MATHEMATICA.pdfUploaded byMustapha El Metoui
- LeBlender_0.9.xUploaded byNelson
- Scilab_beginners.pdfUploaded bySatyanarayana Gurram
- Result CCA ArboretumUploaded byRandi Hendrawan
- R.programming Online Training In HyderabadUploaded bynaveen airiss
- Computer Science - SylUploaded bymodiark
- Tata Consultancy ServicesUploaded byVijaya Kumar
- rrefUploaded byDivij
- I YEARUploaded byrawani_rizwan
- WAVELET_PSO-BASED_LQR_ALGORITHM_FOR_OPTI.pdfUploaded byFilipus Ivan Denata
- NEW Curriculum. Chemical 2006-1Uploaded bylawrence
- Www.mathworks.com Support Tech-notes 1200 1207Uploaded byParvin Surwade
- Functions and Data StructuresUploaded byYulNguyen
- Ft Sem 1 New Syllabus 12Uploaded bysetti
- UntitledUploaded bya4224219
- FR200Uploaded bynarendraideal
- #!MACDonchartUploaded byNeoHooda
- path hUploaded byapi-316663272
- Msqe Pea 2016Uploaded byblahblah
- Basic MatlabUploaded byAshish Jagani
- Lab Four 1133Uploaded bySun Java
- 1-s2.0-0020740372900410-mainUploaded byNir Sho
- 08_Formulas and ObjectsUploaded byDoola
- The Ring programming language version 1.5.3 book - Part 72 of 184Uploaded byMahmoud Samir Fayed
- Is Economic Calculation Hyper Computational?Uploaded byFar Left Politics
- Reporting Point Backflush in REM ProcessUploaded byvibin.v.joseph
- (1)Uploaded byjojon
- IFAC2005linUploaded byscrdld
- Mathematical Model and Six-Degree-Of-Freedom Simulation of Two Business Jet AircraftUploaded byKishan Chowhan
- Assignment ProblemUploaded bySharvari Shankar

- WHMIS LabVersion Aug2012 %5b4 Pages%5dUploaded byMayisha Fabliha
- DAN 6 ExampleUploaded byMayisha Fabliha
- Final InfographicUploaded byMayisha Fabliha
- Fundamentals of Aerodynamics - John D. Anderson, Jr. - Insructor's Solution ManualUploaded byMayisha Fabliha
- ConformalUploaded byMayisha Fabliha
- Midterm 2 F09Uploaded byMayisha Fabliha
- MECH 383-Lab 1Uploaded byMayisha Fabliha
- Fluids ReportUploaded byMayisha Fabliha
- MATH317 Notes After MidtermUploaded byMayisha Fabliha
- Dyna Mech Crib SheetUploaded byMayisha Fabliha
- midterm 2Uploaded byMayisha Fabliha
- Midterm 2 F09Uploaded byMayisha Fabliha
- solution manual for manufacturingUploaded byMayisha Fabliha
- Lecture 10 - Abrasive Machining and Finishing Operation-W15Uploaded byMayisha Fabliha
- ocr_7770_sam_gce_unit_f325Uploaded byMayisha Fabliha
- 6106_03_msc_20090206Uploaded byMayisha Fabliha
- Lecture 9 - CNC Technology and Economics of Machining-W15Uploaded byMayisha Fabliha
- 39978500-Ch7Uploaded byMayisha Fabliha
- Chap 5Uploaded byMayisha Fabliha
- MECH 383-Lab 1Uploaded byMayisha Fabliha
- InertiaUploaded byMayisha Fabliha
- Chap 5Uploaded byMayisha Fabliha
- This Preparation Produces Ethanal in Aqueous SolutionUploaded byMayisha Fabliha
- 1.2 How Does the CLS Synch Rot Ron WorkUploaded byMayisha Fabliha