A graph is a set of nodes and edges that connect those nodes.

There are two types of graphs; directed and undirected. In an undirected graph, the edges between nodes have no particular direction (like a two-way street) whereas in a directed graph, each edge has a direction associated with it (like a one-way street).
For two nodes in a graph to be considered adjacent to one another, there must be an edge between them. In the example given above, nodes 0 and 1 are adjacent, but nodes 0 and 2 are not.
We can encode graphs using an adjacency matrix. An adjacency matrix for a graph with "n" nodes is an "n * n" matrix where the entry at row "i" and column "j" is a 0 if nodes "i" and "j" are not adjacent, and 1 if nodes "i" and "j" are adjacent.
For the example above, the adjacency matrix would be as follows:
[
[ 0, 1, 0, 0 ],
[ 1, 0, 1, 1 ],
[ 0, 1, 0, 1 ],
[ 0, 1, 1, 0 ]
]
A one indicates that a connection is true and a zero indicates a connection is false.
Here is how the above model might be written out:
Your task is to determine if two nodes are adjacent in an undirected graph when given the adjacency matrix and the two nodes.

Adjacency Matrix:
[
[ 0, 1, 0, 0 ],
[ 1, 0, 1, 1 ],
[ 0, 1, 0, 1 ],
[ 0, 1, 1, 0 ]
]
0,1 should return True.0,2 should return False.
[
[ 0, 1, 0, 1, 1 ],
[ 1, 0, 1, 0, 0 ],
[ 0, 1, 0, 1, 0 ],
[ 1, 0, 1, 0, 1 ],
[ 1, 0, 0, 1, 0 ]
]
0,3 should return True.1,4 should return False.