Question: Code in Java please You are going to create a program that has two matrices depicting two separate directed graphs. You will multiply the two

Code in Java please

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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!