Find Jobs
Hire Freelancers

C++ Programming

$30-40 USD

Dibatalkan
Dibuat lebih dari 11 tahun yang lalu

$30-40 USD

Dibayar ketika dikirim
Network Communication Simulation using multidimensional vector ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Due: September 27th, 1:00pm + Please only submit [login to view URL] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1. Model the network . We want to simulate the communication cost between different nodes in a network. How to model the network nodes and communication cost? what does the data looks like? how to find the most economical way to communicate? The answer is: you can use multidimensional vector (array) to represent the communication cost of the network, the index of the 2D vector indicate different nodes. For example, if you have 5 nodes in the network, you will use a 5 * 5 two dimensional vector. In computer science, we call it weight matrix. Following is how to get weight matrix: As above examples, the graph indicates the networks. It has notes, each edge is a direct connection for two nodes. The value for each edge is the communication cost (weight). The weight for node its self is 0, as w[i][i]. If there is no direct connection for two nodes, we use weight 999. 2. How to calculate the communication cost for every pair of nodes. Although there may be no direct connection for two nodes, (like the node 0 and 3 on right picture), they still can connect through other node (like 0 ->2->3 or 0->1->2->3). It is very important to find the most efficient way to communicate, which means the cost of the whole path cost less. We can use Floyd-Warshall method to calculate. The code for this function will be provide in this lab, you can directly call this function. For the path information: we need to 3D vector to store the cost information of each pair of nodes. Like path[n][n][n]. The final result of the most efficient path is located on path[n-1][ ][ ] 2D vector. The first n-1 2D vector of this 3D vector are the history of how each pair are updated step by step to the final result. Use above 3 nodes network as example the final result of all pair cost will be shown in path[2][ ][ ] as 0 1 3 1 0 2 3 2 0 3. What you need to do. Part of the code has been provide in main.cpp. The weight matrix and path matrix are created after the user input the size of the network, that is why we use vector instead of array. The size of network is stored in a global integer “nodes”. You need to finish the code for the following functions. void loadWeight(matrix &w); //load the data into weight matrix void printWeightMatrix(matrix w);// print out the current weight matrix void pathReport(matrix w, matrix3D p);//generate the path report void checkConnection(matrix3D p); //check the Connection for two nodes void updateWeight(matrix &w, matrix3D &p); //update the direct connection for two nodes 4. Output report. The pathReport(matrix w, matrix3D p) function will generate a report for the current weight matrix and path matrix. Please see the example output to follow the same output format. 5. Update Weight The updateWeight(matrix &w, matrix3D &p) will ask user to input two indexes of nodes, and the new weight to replace the old weight. You also need to update the path matrix after updating weight, because the path matrix is related to the weight matrix. 6. checkConnection(matrix3D p) function will ask user to input two indexes of nodes. Then check if these two nodes has a valid path. If yes, print out the cost. If not, print out there is no connection. 7. loadWeight(matrix &w)function process the data file. The data file contains an integer first which is the size of network. You need to first compare with the network you just created. If the size does not match, you should stop reading the file and print out message to show user that the file is wrong.
ID Proyek: 2519231

Tentang proyek

4 proposal
Proyek remot
Aktif 12 tahun yang lalu

Ingin menghasilkan uang?

Keuntungan menawar di Freelancer

Tentukan anggaran dan garis waktu Anda
Dapatkan bayaran atas pekerjaan Anda
Uraikan proposal Anda
Gratis mendaftar dan menawar pekerjaan
4 freelancer menawar dengan rata-rata $33 USD untuk pekerjaan ini
Avatar Pengguna
ready to finish this asap
$40 USD dalam 1 hari
5,0 (44 ulasan)
5,6
5,6
Avatar Pengguna
Its a can do. I am a computer engineering student and can certainly handle Floyd-Warshall.
$30 USD dalam 2 hari
5,0 (13 ulasan)
4,7
4,7
Avatar Pengguna
Hello, we are experts in C++ programming and can complete this task in a few hours.
$30 USD dalam 0 hari
5,0 (2 ulasan)
4,4
4,4
Avatar Pengguna
Hi. I can surely satisfy you in this project. Please give me a chance to work with you. Regards, Tri
$30 USD dalam 0 hari
4,4 (9 ulasan)
3,8
3,8

Tentang klien

Bendera INDIA
New Delhi, India
4,9
16
Anggota sejak Agu 24, 2008

Verifikasi Klien

Terima kasih! Kami telah mengirim Anda email untuk mengklaim kredit gratis Anda.
Anda sesuatu yang salah saat mengirimkan Anda email. Silakan coba lagi.
Pengguna Terdaftar Total Pekerjaan Terpasang
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuat pratinjau
Izin diberikan untuk Geolokasi.
Sesi login Anda telah kedaluwarsa dan Anda sudah keluar. Silakan login kembali.