Task For this assignment you are to find a solution to a gra
Task
For this assignment, you are to find a solution to a graph problem by utilizing various structures that we have discussed and used this past semester. You will be able to choose the language of your choice however I will mostly only be able to assist if you choose to use C++. Below you will find the details of the problem, think about what you must achieve and plan your approach BEFORE starting to write code.
For this project you will be in charge of helping travelers schedule their trips on trains which are leaving and arriving at various stations. You are to create a program that will let a user find a path between two stations among other features. You will be provided with two files: trains.dat which will have the schedule of trains running between stations and stations.dat which contains the list of stations that are in your train network. Your program will provide the following functionality:
- Print complete train schedule
o Output: Prints off the complete train schedule for the day. Should state what station the train is departing from, at what time it departs, where it will arrive, what time it will arrive, and what the travel time between the two stations is.
- For a station number, print the name
o Input: Station Number
- For a station name print the station number
o Input: Station Name
- Determine if there is a direct route from station A to station B
o Input: Departure and Arrival station number
- Is station B reachable from station A
o Input: Departure and Arrival station number
- For any two stations what is the shortest ridding time(hours:minutes) to go from A to B
o Only time spent on train
o If no route exists alert the user
o Input: Departure and Arrival station number
- Find the shortest OVERALL travel time
o Time riding the train and time waiting for layovers at other stations
o Input: Departure station number, Arrival station number, time you will arrive at your departure station in 24 hour time(HH:MM)
File Format
stations.dat
<station_number> <station_name>
station number - [0->99] not necessarily in order
station name – max length of 25, no spaces
Example file
0 Madison
1 Brookings
2 Sioux_Falls
3 Fargo
trains.dat
<departure station> <arrival station> <departure time> <arrival time>
departure_staiton number: 0-99
arrival_station number: 0-99
departure_time: 0-1440
arrival_time: 0-1440
Departure time and arrival time are in terms of minutes since midnight
No trains will run past midnight
Option: 0 brookings leaves at 500 and arrives at 2-huron at 510, 0 hr and 10 min total 0-brookings leaves at 230 and arrives at 1-madison at 240, 0 hr and 10 min total 1-madison leaves at 10 and arrives at 4-sioux falls at 85, 1 hr and 15 min total 2-huron leaves at 800 and arrives at 1-madison at 845 0 hr and 45 min total 3-rapid city leaves at 500 and arrives at 1-madison at 525, 0 hr and 25 min total rapid city leaves at 300 and arrives at 0-brookings at 400 1 hr and 40 min total 4-Sioux falls leaves at 720 and arrives at 3-rapid city at 758, 0 hr and 38 min total Option 1 Enter station number 2 Station 2 huron option: 3 Enter departure station number: 0 Enter arrival station number 4 No direct route available Option 4 Enter departure station number: 1 Enter arrival station number 3 There is a route from madison to rapid city. Option: 5 Enter departure station number: 1 Enter arrival station number: 2 To go from from madison to huron you will need to ride the train for 3 hours and 43 minutes. option: 6 Enter departure station number: 0 Enter arrival station number: 3 At what time will you arrive at the station: 06:30 To go from Madison to Fargo, your total travel time, when leaving at 06:30 will be 30 hours and 8 minutes Leave Madison at 8:20 and arrive at Sioux Falls at 8:30 Leave Sioux Falls at 13:20 and arrive at Brookings at 14:05 Leave Brookings at 0:10 and arrive at Rapid City at 1:25 Leave Rapid City at 12:00 and arrive at Fargo at 12:38Solution
Sequence Alignment or sequence comparison lies in spite of appearance of the bioinformatics, that describes the approach of arrangement of DNA/RNA or macromolecule sequences, so as to spot the regions of similarity among them. it\'s wont to infer structural, useful and biological process relationship between the sequences. Alignment finds similarity level between question sequence and completely different info sequences. The algorithmic program works by dynamic programming approach that divides the matter into smaller freelance sub issues. It finds the alignment a lot of quantitatively by assignment scores.
 
 When a replacement sequence is found, the structure and performance will be simply expected by doing sequence alignment. Since it\'s believed that, a sequence sharing common ascendent would exhibit similar structure or perform. bigger the sequence similarity, bigger is that the likelihood that they share similar structure or perform.
 
 
 Methods of Sequence Alignment:
 
 There square measure primarily 2 strategies of Sequence Alignment:
 
 Global Alignment : Closely connected sequences that square measure of same length square measure much applicable for international alignment. Here, the alignment is dole out from starting until finish of the sequence to search out out the simplest potential alignment.
 
 The Needleman-Wunsch algorithmic program (A formula or set of steps to unravel a problem) was developed by Saul B. Needleman and Christian D. Wunsch in 1970, that could be a dynamic programming algorithmic program for sequence alignment. The dynamic programming solves the initial drawback by dividing the matter into smaller freelance sub issues. These techniques square measure utilized in many various aspects of engineering science. The algorithmic program explains international sequence alignment for positioning ester or macromolecule sequences.
 
 Local Alignment : Sequences that square measure suspected to possess similarity or perhaps dissimilar sequences will be compared with native alignment technique. It finds native regions with high level of similarity.
 
 These 2 strategies of alignments square measure outlined by completely different algorithms, that use grading matrices to align the 2 completely different series of characters or patterns (sequences). {the 2|the 2} {different|totally completely different|completely different} alignment strategies square measure largely outlined by Dynamic programming approach for positioning two different sequences.
 
 Dynamic Programming:
 
 Dynamic programming is employed for optimum alignment of 2 sequences. It finds the alignment in an exceedingly a lot of quantitative approach by giving some scores for matches and mismatches (Scoring matrices), instead of solely applying dots. By looking out the best scores within the matrix, alignment will be accurately obtained. The Dynamic Programming solves the initial drawback by dividing the matter into smaller freelance sub issues. These techniques square measure utilized in many various aspects of engineering science. Needleman-Wunsch and Smith-Waterman algorithms for sequence alignment square measure outlined by dynamic programming approach.
 
 Scoring matrices:
 
 In optimum alignment procedures, largely Needleman-Wunsch and Smith-Waterman algorithms use classification system. For ester sequence alignment, the grading matrices used square measure comparatively less complicated since the frequency of mutation for all the bases square measure equal. Positive or higher price is appointed for a match and a negative or a lower price is appointed for pair. These assumption based mostly scores will be used for grading the matrices. There square measure different grading matrices that square measure predefined largely, utilized in the case of organic compound substitutions.
 
 Mainly used predefined matrices square measure PAM and BLOSUM.
 
 PAM Matrices: Margaret Dayhoff was the primary one to develop the PAM matrix, PAM stands for purpose Accepted Mutations. PAM matrices square measure calculated by perceptive the variations in closely connected proteins. One PAM unit (PAM1) specifies one accepted gene mutation per a hundred organic compound residues, i.e. one hundred and twenty fifth amendment and ninety nine remains in and of itself.
 
 BLOSUM: BLOcks SUbstitution Matrix, developed by Henikoff and Henikoff in 1992, used preserved regions. These matrices square measure actual proportion identity values. merely to mention, they depend upon similarity. Blosum sixty two suggests that there\'s sixty two Gestalt law of organization.
 
 Gap score or gap penalty: Dynamic programming algorithms use gap penalties to maximise the biological that means. Gap penalty is subtracted for every gap that has been introduced. There square measure completely different gap penalties like gap open and gap extension. The gap score defines a penalty given to alignment after we have insertion or deletion. throughout the evolution, there is also a case wherever we are able to see continuous gaps right along the sequence, that the linear gap penalty wouldn\'t be applicable for the alignment. therefore gap open and gap extension has been introduced once there square measure continuous gaps (five or more). The open penalty is often applied at the beginning of the gap, so the opposite gaps following it\'s given with a niche extension penalty which is able to be less compared to the open penalty. Typical values square measure –12 for gap gap, and –4 for gap extension.
 
 Working of Needleman -Wunsch algorithmic program
 
 To study the algorithmic program, take into account the 2 given sequences.
 
 CGTGAATTCAT (sequence #1) , GACTTAC (sequence #2)
 
 The length (count of the nucleotides or amino acids) of the sequence one and sequence a pair of square measure eleven and seven severally. The initial matrix is made with A+1 column’s and B+1 row’s (where A and B corresponds to length of the sequences). additional row and column is given, therefore on align with gap, at the beginning of the matrix as shown in Figure one.
Figure 1: Initial matrix
 
 After making the initial matrix, grading schema should be introduced which might be user outlined with specific scores. the straightforward basic grading schema will be assumed as, if 2 residues (nucleotide or amino acid) at ith and jth position square measure same, matching score is one (S(i,j)= 1) or if the 2 residues at ith and jth position don\'t seem to be same, pair score is assumed as -1 (S(i,j)= -1 ). The gap score(w) or gap penalty is assumed as -1 .
 
 *Note: The a lot of match, pair and gap will be user outlined, provided the gap penalty ought to be negative or zero.
 
 Gap score is outlined as penalty given to alignment, after we have insertion or deletion.
 
 The dynamic programming matrix is outlined with 3 completely different steps.
 1.Initialization of the matrix with the scores potential.
 2.Matrix filling with most scores.
 3.Trace back the residues for applicable alignment.




