Find Jobs
Hire Freelancers

C++ Programming

$30-40 USD

已取消
已发布超过 11 年前

$30-40 USD

货到付款
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: 2519231

关于此项目

5提案
远程项目
活跃12 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
5威客以平均价$33 USD来参与此工作竞价
用户头像
ready to finish this asap
$40 USD 在1天之内
5.0 (44条评论)
5.6
5.6
用户头像
Its a can do. I am a computer engineering student and can certainly handle Floyd-Warshall.
$30 USD 在2天之内
5.0 (13条评论)
4.6
4.6
用户头像
Hello, we are experts in C++ programming and can complete this task in a few hours.
$30 USD 在0天之内
5.0 (2条评论)
4.4
4.4
用户头像
Hi. I can surely satisfy you in this project. Please give me a chance to work with you. Regards, Tri
$30 USD 在0天之内
4.4 (9条评论)
3.8
3.8
用户头像
Hello, anupam07ii. I understand your project needs. I have more than 13 years of experience in algorithms and over 6 years of experience in C/C++ programming. You can look at my portfolio for code examples of my previous work. What time zone do you live in?
$35 USD 在1天之内
5.0 (6条评论)
2.8
2.8

关于客户

INDIA的国旗
New Delhi, India
4.9
16
付款方式已验证
会员自8月 24, 2008起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。