Scenario: It is the year 20XX and the tech firm Orange, Inc. has discovered a significant breakthrough
in teleportation technology. Orange is able to build a network of n teleportation stations to allow
people to quickly traverse the cities that they live in. A test network is being built in the Montgomery,
AL area, and you have been hired to design the software to manage the route data. While teleportation
is an amazing new technology, it has a number of limitations:
• Each teleportation station (node) has exactly one exit point node.
• Each route (arc) between nodes is one-way and you may not be able to return the way you
came.
The system offers exactly one choice for a ticket, allowing a person to travel up to k arcs at a time.
Due to health concerns, a human being can not safely travel through more than k arcs in a sequence.
The farthest anyone could safely travel is up to k nodes away. Before starting your trip, the system will
automatically verify that you are not planning to travel a distance exceeding k arcs.
The system must be programmed with a list of valid starting stations for each destination station, but
the more memory the list needs, the more expensive the machine will be. Help Orange by determining,
for each station S, the number of stations (including S) from which a customer can reach S in at most k
arcs.
Your program should take in a single text file as input. The format of the file is as follows:
The first line of input contains two integers n and k, where n is the number of teleportation
stations and k is the maximum number of arcs that a customer can safely travel. Then follow n lines,
the jth of which contains an integer dj, which represents the station which may be reached from station j
in one arc.
For example, consider a text file with the following format:
6 2
2
3
4
5
4
3
The network of teleportation stations, arcs, and source nodes that a customer could start from that
could take them as far the destination node looks as follows:
So, based on the input file, we have 6 nodes total and a person could safely travel up to 2 arcs away.
This means that a customer who wants to end up at node 3, could start at most 2 arcs away at 1, 2, 3, or
6. Remember that the arcs are one-way and there is no way to get from node 4 or 5 back to 3.
Your program should output n lines, with the jth line containing the number of stations from which
station j can be reached in at most k arcs. So, for the above example, your output should look like:
1
2
4
5
3
1
I have included some sample input files for you on Blackboard. You will need to write a program
which fulfills the requirements of the above problem description. You will complete the design of the
route calculation system using C++ and Test Driven Development.
budget 20 usd
Important: I already got the solution for this problem. I am a software engineer at Nutanix. I have really good hands on experience in C,C++, Java, Python. I have been participating in competitive programming for last 5 years. I am really good at Data structures and algorithms. you can check my competitive profiles for reference. I went ACM ICPC Regionals under 20 and Snackdown Elimination under 100. Won Inter NIT Coding contest. I have 5-star Rating in Codechef (2000+). I can implement and give you on time and I take care of effeciency.
Thanks & Regards,
Ch Bhanu Prakash
$20 USD in 1 day
5.0 (1 review)
1.6
1.6
6 freelancers are bidding on average $16 USD for this job
Hii there ,
I am bidding on your project and I am good at this field I can do this for you within due time and honestly. I also have a few questions to discuss. Kindly contact me and we will discuss time and budget. Thanks
Hi Dear,
I read your description carefully and I am filled with confidence that I can complete your project wonderfully.
I have some experience over 5+ years with C, C++.
If you give me a chance, I will do my best to complete this project for us.
I can complete this project with the best quality in time.
I hope your kind reply.
Best Regards.
Chian Y.
Hi There, I have made a program for a restaurant that is quite similar to one you need and i believe i can make yours also. i know how to extract data from text files as you mentioned and i can use OOP to write your program. I noticed that you added Genetic algorithm in your description. if you are willing to use genetic algorithm then we need to discuss more about it and which one do you want to use and what variable will be iterated..contact me to discuss more about it.
I have gone through your description. I could do your requirements easily. I have 4 years of experience in c and c++.
I will do best to full fill your requirement.
Best regards,
Ram