# Search Results

Results tagged with Search options user 89
34 results

Questions about handling graphs in Mathematica, graph theory, graph visualization, GraphPlot, the built-in Graph type and the Combinatorica` package.

Since vertices in VertexCoordinates are listed according to the graphs own vertex order (that is not necessarily {1, 2, ..., n}), it is safer to extract VertexList also to make the node $\rightarrow$ …
answered Sep 8 '13 by István Zachar
A more straightforward way is to use SetProperty on the resulting graph to restore the original vertex coordinates. g = Graph[{2 -> 4, 1 -> 2, 2 -> 3, 3 -> 1, 5 -> 4, 4 -> 6, 1 -> 7, 2 -> 7}, …
answered Sep 8 '13 by István Zachar
This is a bit different approach. A balanced bipartite graph (where the two vertex sets have the same cardinality, $N$) can be represented as an adjacency matrix, where the rows and columns of the mat …
answered Mar 14 '13 by István Zachar
I used this generator algorithm for DAGs (by Szabolcs): {vertices, edges} = {7, 10}; elems = RandomSample@PadRight[ConstantArray[1, edges], vertices (vertices-1)/2]; adj = Take[FoldList[RotateLeft, e …
answered Oct 8 '13 by István Zachar
The problem here is that EdgeDelete[G, e] does not remove the appropriate weight $w_e$ from the properties of graph $G$ (I would say this is a bug, though it is the last one in a very long list for Gr …
answered Oct 17 '13 by István Zachar
The following algorithm finds all paths from vertex s to vertex t in a directed graph represented by the adjacency matrix a (note that here s and t are for vertex positions and not vertex names!). fi …
answered Oct 16 '13 by István Zachar
You can iterate through the vertex-, and edgelists of connected components: SeedRandom@11; g = RandomGraph[{15, 20}, DirectedEdges -> True, EdgeStyle -> GrayLevel@.8, VertexLabels -> "Name", …
answered Sep 9 '13 by István Zachar
I posted a way to update options of Graph objects like Show works for Graphics here, could you please confirm whether this is a solution for your needs with recomputing the layout? Options[showGraph] …
answered Nov 26 '13 by István Zachar
In version 9, one can use the new built in layout version of Graph for trees: GraphLayout -> "LayeredDigraphEmbedding". Graph[{1, 2, 3, 4, 5, 6, 7}, {1 -> 2, 2 -> 3, 4 -> 6, 5 -> 6, 7 -> 4}, Vert …
answered Apr 12 '13 by István Zachar
It works if you specify weights in the following way: g = Graph[{{1, 2} -> {3, 4}, {5, 6} -> {7, 8}}]; g = SetProperty[g, VertexWeight -> {{1, 2} -> 10}]; PropertyValue[g, VertexWeight] {10, 1, 1, …
answered Sep 14 '13 by István Zachar
In Mathematica 9+ one can use "MultipartiteEmbedding" with appropriate partitioning: g = {0 -> 1, 1 -> 2, 2 -> 3, 0 -> 4, 0 -> 5, 2 -> 6, 2 -> 7, 8 -> 3, 4 -> 9, 5 -> 9, 6 -> 9, 6 -> 10, 7 -> 10, …
answered Oct 16 '13 by István Zachar
CommunityGraphPlot has this feature implemented internally: g = ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]; CommunityGraphPlot[g] The information about bundling is calculated by Commun …
answered Jan 9 '14 by István Zachar
At least in v9 if you provide an explicit vertex list for Graph, it maintains that order of the vertices (unless you add/remove vertices or edges via e.g. VertexAdd or EdgeAdd). So your suggested meth …
answered Oct 17 '13 by István Zachar
For directed graphs (cyclic or acyclic), here is a simple method that recursively scans the neighbours of a source vertex s until it finds all paths to a target vertex t (either using the graph or its …
answered Oct 16 '13 by István Zachar
This is a bug: Technical Support gave the following answer acknowledging the problem: "It does appear that the input you mention is not behaving properly, and I have forwarded an incident report …
answered Sep 16 '13 by István Zachar

15 30 50 per page