Vaclav Hapla <[email protected]> writes: >>> Yes. Mat can represent any graph in several different ways - >>> e.g. Laplacian, adjacency, incidence, oriented incidence matrix. The >>> graph could be also represented in other way like a list of vertices >>> and edges. >> >> Also known as COO format for a matrix. > > You could represent by COO any of the matrices above. I don't understand how > it relates to listing vertices and edges of a graph.
COO is literally a list of edges. Square matrices and graphs are the same thing. >> >>> MatPartitioning picks just one representation as an input - the >>> adjacency matrix. But I mean the picked representation does not >>> matter, and the result is not a partitioning of any matrix, but >>> partitioning of the graph. The graph is the underlying concept. This >>> is why I don't consider the Mat prefix optimal. >> >> Matrix and graph are equivalent concepts. > > I think that's an overly strong statement. It sounds like a matrix and a > graph are bijectively interchangeable things which is certainly not true: > 1) As I mentioned, there are multiple ways of representing a graph by a > matrix, and for a given graphs these matrix representations don't even have > the same dimensions. > 2) Even if you stick to the adjacency matrix (which you apparently do), it's > still not bijective with the graph - the adjacency matrix is a square > symmetric Boolean matrix. You can just say that the _sparse pattern_ of the > _symmetric_ matrix is bijective with the respective graph. This is a by far > weaker statement. Graphs can have edge weights. A symmetric matrix is an undirected graph. A nonsymmetric matrix is a directed graph. > Why you then have a special matrix type MATMPIADJ which is value-less MatCreateMPIAdj literally has an argument named "values". > and automatically symmetric if all matrices "are" graphs? It is not "automatically symmetric" -- you have to declare that with MatSetOption as documented in the man page. A partitioner for an undirected graph may require that the input is symmetric, much like how CG will fail if the input is not SPD.
