[Solved] CS4050 Assignment 5- Graph

$25

File Name: CS4050_Assignment_5__Graph.zip
File Size: 244.92 KB

SKU: [Solved] CS4050 Assignment 5- Graph Category: Tag:
5/5 - (1 vote)

arbitragethe simultaneous buying and selling of the same negotiables or commodities in different markets in order to make an immediateprofit. (Encarta(R) World English Dictionary (C) 1999)One market where arbitrage can be applied is in the buying and selling of currencies. Dollars can be exchanged for pounds that can beexchanged for pesos that can be exchanged for dollars to end up with more dollars than you started with.The assignmentYour assignment is to:1. build a directed weighted graph that represents exchange rates. Each node of the graph represents a currency (such as dollars) andeach directed weighted edge represents the exchange rate (the edge weight is what you multiply the from-node by to get thecorresponding amount of currency in the to-node).2. find sequences of trades that will result in a profit. Print out the trades and the resulting profit if $1000 is invested (or 1000 of thecurrency that you start with).Input DataThe input data should be read in from a file that has the following format:The first line in the file contains an int representing the number of different currencies.Each subsequent line represents one exchange with the name of the from-node, the name of the to-node and a real number thatshows the exchange rate.For example, the file might look like the following:4dollar peso .0412franc pound 1.731dollar pound 1.0153peso franc 14.321peso dollar 24.8804pound franc .58793

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS4050 Assignment 5- Graph[Solved] CS4050 Assignment 5- Graph
$25