Here is one way to do it (with much room for improvement). Given a list of node relations:
\newcommand{\NodeRelations}{%
(1,1),
(1,2),
(1,5),
(2,1),
(2,3),
(2,5),
(3,2),
(3,4),
(4,3),
(4,5),
(4,6),
(5,1),
(5,2),
(5,4),
(6,4)
}%
you use the MyMatrix environment and pass in dummy data:
\begin{MyMatrix}{\NodeRelations}
- & - & - & - & - & - \\
- & - & - & - & - & - \\
- & - & - & - & - & - \\
- & - & - & - & - & - \\
- & - & - & - & - & - \\
- & - & - & - & - & - \\
\end{MyMatrix}
which gets replaced with a 1 or 0:

Code:
\documentclass{article}
\usepackage{pgffor}
\usepackage{xstring}
\usepackage{collcell}
\usepackage{etoolbox}
\newcounter{RowCount}
\newcounter{ColCount}
\newcommand{\NextColumn}[1]{%
\addtocounter{ColCount}{1}%
\IfIsInNodeRelations{\arabic{ColCount}}{\arabic{RowCount}}{1}{0}%
}
\newcommand{\FirstColumn}[1]{%
\setcounter{ColCount}{0}%
\addtocounter{RowCount}{1}%
\NextColumn{#1}%
}
\newtoggle{IsInNodeRelations}
\newcommand*{\IfIsInNodeRelations}[4]{%
\global\togglefalse{IsInNodeRelations}%
\foreach \Node in \NodeRelations {%
\StrBetween{\Node}{(}{,}[\x]
\StrBetween{\Node}{,}{)}[\y]
\IfEq{\x}{#1}{%
\IfEq{\y}{#2}{%
\global\toggletrue{IsInNodeRelations}%
\breakforeach%
}{}%
}{}%
}%
\iftoggle{IsInNodeRelations}{#3}{#4}
}
\newcommand{\NodeRelations}{%
(1,1),
(1,2),
(1,5),
(2,1),
(2,3),
(2,5),
(3,2),
(3,4),
(4,3),
(4,5),
(4,6),
(5,1),
(5,2),
(5,4),
(6,4)
}%
\newcommand{\ExtractedX}{}%
\newcommand{\ExtractedY}{}%
\def\ExtractXY(#1,#2){%
\xdef\ExtractedX{#1}%
\xdef\ExtractedY{#2}%
}%
\newenvironment{MyMatrix}[1]{%
% #1 = List of node relations
\newcolumntype{F}{>{\collectcell\FirstColumn}c<{\endcollectcell}}%
\newcolumntype{C}{>{\collectcell\NextColumn}c<{\endcollectcell}}%
\setcounter{RowCount}{0}
\setcounter{ColCount}{0}
$\left[\begin{array}{F C C C C C}%
}{%
\end{array}\right]$%
}%
\begin{document}
\begin{MyMatrix}{\NodeRelations}
- & - & - & - & - & - \
- & - & - & - & - & - \
- & - & - & - & - & - \
- & - & - & - & - & - \
- & - & - & - & - & - \
- & - & - & - & - & - \
\end{MyMatrix}
\end{document}