Question
Do it in Java You are going to create a program that has two matrices depicting two separate directed graphs. You will multiply the two
Do it in Java
You are going to create a program that has two matrices depicting two separate directed graphs. You will multiply the two matrices (Book 6.6.2). Then you will print out the new matrix and tell me the number of connections within the matrix (add up the values inside the matrix).
There are 4 vertices in this directed graph. We know that because there are 4 rows and 4 columns. If there is a 1 that means that the vertex on the left (you need to name them) has an arrow edge towards the vertex on the top. If there is a 0 that means there are no edges from the vertex on the left to the top vertex.
Matrix 1:
1 | 0 | 0 | 1 |
0 | 1 | 0 | 1 |
0 | 0 | 1 | 0 |
1 | 1 | 1 | 0 |
Matrix 2:
0 | 1 | 1 | 1 |
1 | 1 | 0 | 1 |
0 | 1 | 0 | 1 |
1 | 0 | 1 | 0 |
- Make sure to program the matrices into your code.
- Output the new matrix created when you multiplied them.
- Output the number of connections within the directed graph being depicted by the new matrix.
Rubric
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started