Are you sure you know what is incidence matrix? wiki 
<https://en.wikipedia.org/wiki/Incidence_matrix>

You don't need any dictionaries to implement it. Just use simple Array().

matrix = fill(false, row_size, col_size)
from_node = scan_input()
to_node   = scan_input()
matrix[from_node, to_node] = true

Reply via email to