I have a problem with the following definition
I have a course with some lessons
- What Java Is and How It Works
- Hello World Program
- Using Variables
- Strings: Working With Text
- While Loops
- For Loops
- "If"
- Getting User Input
- Do ... While
- Switch
- Arrays
- Arrays of Strings
- Multi-Dimensional Arrays
- Methods 15.Method Parameters
- Static
- Final
- String Builder and String Formatting
I have build a network with this course with matrix as following :
Node 1: first lesson
Node 2: second lesson
From Node 1 to Node 2 the edge will be 1 and to all other nodes will be 0
From Node 2 to Node 3 and from Node 2 to Node 4 the edge will be one and and to all other nodes it will be 0 because student can move from node 2 to 3 or 4
And so on with the same logic.
I got the following matrix:
D = [[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0],
[0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1],
[0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
[0,0,0,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0],
[0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,1],
[0,0,1,1,1,1,1,0,1,0,1,0,0,1,0,0,0,1],
[0,0,0,0,1,1,1,0,0,0,1,0,0,1,0,0,0,0],
[0,0,0,0,1,1,0,0,1,0,1,0,0,1,0,0,0,0],
[0,0,0,0,1,1,1,0,1,0,0,1,1,1,0,0,0,0],
[0,0,0,0,1,1,1,0,1,0,0,0,1,1,0,0,0,0],
[0,0,0,0,1,1,1,0,1,0,0,0,0,1,0,0,0,0],
[0,0,0,0,1,1,1,0,1,0,1,0,0,0,1,1,1,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0],
[0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0]]
and run the algorithm of salesperson the result is : [1, 3, 5, 15, 7, 10, 8, 9, 17, 18, 2, 4, 6, 16, 13, 11, 12, 14, 1]
I have tried to add -1 and to flip 0 with 1 and 1 with 0 and tried different matrix and still the data not near what the student should follow