Please help in PythonPART B: Network/Traffic Flow Part B1: Background Concepts for Network/Traffic Flow Network analysis plays an important role in many industries such as engineering, information theory, and the study of transportation systems. The following analysis of traffic flow through a road network illustrates how systems of linear equations with many solutions can arise in practice. Consider the typical road network of Figure 1. It represents an area of a downtown city. The streets are all one-way, with arrows indicating the direction of traffic flow. The flow of raffic in and out of the network is measured in terms of vehicles per hour (vph). We can construct a mathematical model that can be used to analyze this network. Assume the following traffic law applies: All traffic entering an intersection must leave that intersection. This conservation of flow constraint (similar to Kirchoffβs Current Law) leads to a system of linear equations: Intersection A: Traffic in = π₯1 + π₯2 Traffic out = 400 + 225 Traffic A: π₯1 + π₯2 = 625 Intersection B: Traffic in = 350 + 125 Traffic out = π₯1 + π₯4 Traffic B: π₯1 + π₯4 = 475 Intersection C: Traffic in = 800 + 225 Traffic out = π₯2 + π₯3 Traffic C: π₯2 + π₯3 = 1050 Intersection D: Traffic in = π₯3 + π₯4 Traffic out = 600 + 300 Traffic D: π₯3 + π₯4 = 900 These constraints on the traffic are described by the following system of linear equations: π₯1 + π₯2 = 625 π₯1 π₯4 = 475 π₯2 + π₯3 = 1050 π₯3 + π₯4 = 900 The method of Gauss-Jordan elimination can be used to solve this system of equations. The augmented matrix and reduced row-echelon form of the above system are as follows: The row-echelon form (ref) of a matrix is obtained from the gauss elimination and has the following properties: β’ All rows of zero are at the bottom β’ The leading entry (the left-most nonzero entry) of every nonzero row is to the right of the leading entry of every row above. β’ Any (m x n) matrix can be in row-echelon form. β’ Some matrices in row-echelon form are also in upper triangular form if the matrix is a square matrix. Reduced row echelon form (rref) βreducesβ the row echelon form by requiring the additional conditions: β’ The leading entry in each nonzero row is 1 β’ Each leading 1 is the only nonzero entry in its column The system of equations that corresponds to this reduced row-echelon form is Expressing each leading variable in terms of the remaining variable, we get As perhaps might be expected, the system of equations has many solutions (x4 is our free variable) and therefore, many traffic flows are possible. A driver does have a certain amount of choice at intersections.Part B2: Assignment for Network/Traffic Flow The following figure represents the traffic entering and leaving a βroundaboutβ road junction. Construct a mathematical model that describes the flow of traffic along the various branches using the values of Flow 1, Flow 2, Flow 3, Flow 4 as input variables.Part B2.1: Write a program that accepts for the four different flow numbers as input values. (Flow 1, Flow 2, Flow 3, Flow 4). Create an augmented matrix from the constraints on the traffic described by the system of linear equations. Part B2.2: Solve this system using the Gauss-Jordan elimination method (use a library) and output the resulting matrix.
![Your task is to implement in Python the following adversarial search algorithms (refer to lecture slides and/or your textbook for details | pseudocode provided below): MiniMax (as specified by the MINIMAX-SEARCH pseudocode below) When the game is complete, your program should display a corresponding message: X WON or O WON TIE X LOST or O LOST MiniMax with alpha-beta pruning (as specified by the ALPHA-BETA-SEARCH pseudocode below), and apply them to play the game of Tic-Tac-Toe (computer). Using any other approach is not going to be accepted. Problem input/command line interface: Your program should: Accept three (3) command line arguments, so your code could be executed with python cs480_P01_AXXXXXXXX.py ALGO FIRST MODE where: - cs480_P01_AXXXXXXXX.py is your python code file name, - ALGO specifies which algorithm the computer player will use: 1 - MiniMax, 2 - MiniMax with alpha-beta pruning, - FIRST specifies who begins the game: X When it is human player's turn, your program should display the following prompt: X's move. What is your move (possible moves at the moment are: | enter 0 to exit the game)? where: is a sorted list of all available moves at the moment, for example, if the board arrangement is: and it is X's move, the prompt should be: What is your move (possible moves at the moment are: 2, 3, 7, 9) | enter 0 to exit the game)? If the user enters anything other than 0/ valid move number (0 should terminate the game) your program should repeat the prompt above. Once the user enters a valid move, display the updated game board on screen. When it is the computer's turn (regardless of the game mode), your program should display (it could be an 'X' or 'O' move): X's selected move: Z. Number of search tree nodes generated: A.A.A where: - Z is the move/action number (a positive integer from the {1, 2, 3, 4, 5, 6, 7, 8, 9} set) selected by computer - A.A.A is the number of search tree nodes generated (the number of MiniMax nodes computer explored before making the decision [including "root"]) to select it. Follow it with the updated game board on screen. - NOTE!!! Computer's search tree move exploration order should be in a sorted fashion (1, 2, 3, 4, 5, 6, 7, 8, 9 | assuming HERE that ALL moves are available). 2 - computer (X) versus computer (O), Example: python cs480_P01_A11111111.py 2 X 1 If the number of arguments provided is NOT three (none, one, two or more than three) or arguments are invalid (incorrect ALGO, FIRST or MODE) your program should display the following error message: ERROR: Not enough/too many/illegal input arguments. and exit. Program details: Specific program details: The Tic-Tac-Toe game board is represented by 3x3 grid with cells numbered as follows - Possible moves/actions for both players match cell numbers (if a player wants to place an 'X' in the middle of the board, the move/action is '5'), Your program should begin by displaying the following information: Last Name, First Name, Axxxxxxxx solution: Algorithm: MiniMax with alpha-beta pruning First: X Mode: human versus computer where: - Axxxxxxxx is your IIT A number, - Algorithm is the algorithm specified by a command line argument, - First is the information who makes the first move as specified by a command line argument, - Mode is the game mode as specified by a command line argument, If the game mode is human versus computer display an empty board first and prompt the user to pick the move (see below)](https://gotit-pro.com/wp-content/uploads/2023/10/9a1b7061-c5a7-48b6-a744-6dc4634c6532-300x277.png)
![The University of Western Ontario Department of Computer Science London, Canada Software Tools and Systems Programming (Computer Science 2211A) LAB7 The week of October 22 - October 28, 2023 This lab is an exercise with pointer arithmetic. Question 2 of the lab exercise is taken from exercise 17 in Chapter 12 of our textbook: C Programming Language: A Modern Approach (Second Edition), by K. N. King. 1. Rewrite the following function to use pointer arithmetic instead of array subscripting. (In other words, eliminate the variables i and all of the [] operators.) Note that for any array a, the expression a[i] is equivalent to *(a+i). int sum_array(const int a[], int n) { int i, sum = 0; for (i = 0; i < n; i++) sum += a[i]; return sum; }](https://gotit-pro.com/wp-content/uploads/2023/10/c80fe157-523d-4b22-a16d-64c419fa011c-300x273.png)
Product
Original price was: $15.00.$10.00Current price is: $10.00.
-33%Download button will appear immediately after successful payment.
Full support will be provided with necessary files installation.
Get impeccable customized solution within 24 hours, hassle-free.
Jed Friend β
Great quality solution, Done way before time
Jonathan Cooper β
Second time coming to this website for a paper and it worked out great.