\HeaderA{write.pajek.bgraph}{Write graphs and their cohesive block hierarchy as Pajek files}{write.pajek.bgraph}
\keyword{graphs}{write.pajek.bgraph}
\begin{Description}\relax
Creates a series of Pajek-compatible files from a \code{bgraph} object
as output by \code{\LinkA{cohesive.blocks}{cohesive.blocks}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
write.pajek.bgraph(graph, filename, hierarchy = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{graph}] A \code{bgraph} object as output by
\code{\LinkA{cohesive.blocks}{cohesive.blocks}}.
\item[\code{filename}] The filename \emph{without file extension} to use.
\item[\code{hierarchy}] Logical. Should a separate \code{.clu} file be
created for each block in the graph? (see details)
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This function writes at least two files to disk. First, the file
\code{filename.net} contains the basic graph structure---vertices and
edges. The second is the file \code{filename.clu}, which clusters the
vertices according to vertex connectivity of their maxmally cohesive
subgraph. This uses the same logic as the default vertex coloring in
\code{\LinkA{plot.bgraph}{plot.bgraph}}.

If \code{hierarchy} is \code{TRUE}, more detailed and complete
information is written to a further series of files.  
For each block a seperate \code{.clu} file is written, each named like
\dQuote{\code{filename\_block2(1).clu}}, where the first number refers to the
block number and the number in parenthesis refers to that block's
cohesion. Finally, if \code{hierarchy} is \code{TRUE}, a tree
representing the block hierarchy is written to
\code{filename\_blocktree.net}, allowing the subset-structure of the
individual block structures to be determined.
\end{Details}
\begin{Note}\relax
This function has not been thoroughly tested, and may contain bugs
\end{Note}
\begin{Author}\relax
Peter McMahan \email{peter.mcmahan@gmail.com}
\end{Author}
\begin{References}\relax
Pajek website:
\url{http://vlado.fmf.uni-lj.si/pub/networks/pajek/}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{cohesive.blocks}{cohesive.blocks}}, \code{\LinkA{plot.bgraph}{plot.bgraph}},
\code{\LinkA{write.graph}{write.graph}}
\end{SeeAlso}

