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

learn more… | top users | synonyms (2)

-2
votes
0answers
39 views

Graphs making on Mathematica by using HAM [on hold]

I'm working on HAM, on graphs making i encounter a problem over and over again that on even iteration it gives a graph of different shape and on odd iteration it gives totally different shape of ...
2
votes
0answers
55 views

Graph, overlapping vertexlabels

The graph I create is based on more then 1000 different word-combinations. A example looks like this: text = {{word, word1}, {word1, word2}, {word1, word3}, {word,word4}, {word,word5}, ...
1
vote
1answer
34 views

Can I rely on the ordering of the adjacency matrix? [closed]

Suppose I have created a Graph[{1,2..n}, {1->3, etc}], and I take the adjacency matrix of that graph. Can I rely on the fact that the i-th entry in the graph is the i-th node in the matrix? Or maybe ...
4
votes
1answer
197 views

Why don't the arrowheads show for this directed graph?

It's very weird, but the first graph is shown as undirected (dots connected by lines, not arrows. The second is shown as directed, with arrows. I'm using the cloud version of Mathematica. ...
3
votes
1answer
25 views

How can I get the vertex labels of an existing graph?

For example, if there is a graph g = CompleteGraph[5, VertexLabels -> {1 -> "v1", 2 -> "v2", 3 -> "v3", 4 -> "v4", 5 -> "v5"}] How can I later ...
0
votes
1answer
28 views

Compute complete graph and make minimum spanning tree

I'd like to plot a complete Graph and then compute the Minimum spanning tree of it. I already can make a complete graph out of a list that countrydata gives me: ...
4
votes
2answers
66 views

Iterative Tree Plot for the Sum of an Integer's Digits Squared

I am trying to make a graph that depicts integers<100 mapping to the sum of their digits squared. I can do this for one iteration, but I don't know how to do it for more than one, or until the new ...
4
votes
2answers
53 views

Graph: vary color/length vertextlabels based on frequency

In this example I use a small network of 5 words. ...
0
votes
2answers
51 views

What is the correct way to assign and use properties of vertices in graphs?

I'm using Mathematica 10, but I'm having a hard time getting it to do anything useful for network analysis because I'm having a hard time working with node properties and analyzing the graph by its ...
6
votes
1answer
87 views

Slow-down encountered for RandomChoice in large lists

I was wondering if anyone could help me to speed up this code snippet which creates simple (sparse) networks by preferential attachment. The algorithm adds a vertex and an edge each time interval. ...
2
votes
0answers
41 views

Functionality of FindMaximumFlow

I know that the superseeded function NetworkFlow (needs Combinatorica) uses Goldberg-Tarjan's Push-Relabel-Algorithm but i cant find any information on Mathematica's build-in-function ...
1
vote
0answers
39 views

reset the value of a variable [closed]

Folks, I have a problem in populating a matrix without overriding the values. After performing computations for various values for j, I want to store these values in following matrix. Here is the ...
0
votes
0answers
53 views

Shortest Common Superstring for all k-length strings on an alphabet

Given all strings of length $k$ of an alphabet of size $n$. This gives $n^{k}$ strings. Now I want to create one superstring that contains all these strings as substrings. They hopefully strongly ...
2
votes
1answer
50 views

Finding nonequivalent 3-cycles and edges of a given graph

So I have three graphs defined by the following nested list, I'm using this list notation instead <-> notation because it is more convenient for another part ...
22
votes
2answers
1k views

Trying to Visualize a Collatz - The Collatz conjecture

So I'm new in this and learning--- and I happen to have this collatz collatz[x_, y_] := If[x == 3*y || x == 2*y + 1 || y == 3*x || y == 2*x + 2, 2, 0] So i want ...
4
votes
1answer
45 views

Why does TreePlot ignore the vertex labels in a TreeGraph argument?

Example (watch the vertex labels): aTree = TreeGraph[{"a" -> "b", "a" -> "c"}, VertexLabels -> "Name"] ...
1
vote
2answers
63 views

Graph generation from a non-paired edge list

The elements in e = {{6414, 6598, 6927}, {7, 1035, 2382, 6927}, …} are the graph nodes; for example, {6414,6598,6927} is ...
1
vote
1answer
59 views

Powerset Animation/Invisible Vertices/Graph Layout

I wanted to visualize the cumulative powerset construction process and came up with two functions: ...
8
votes
2answers
259 views

Creating a hyperlink graph from Wikipedia

This goes out to all the Mathematica experts - I'm hoping to get some helpful comments, ideas or code for that matter. In my attempts to maximize learning efficiency I had the idea to create an ...
1
vote
0answers
31 views

Unexpected behaviors with Edge Weights

Noticed some bizarre behavior when subgraphing on weighted graphs, which probably extends to graphs with arbitrary edge properties. I construct a weighted graph with five edges, defining a specific ...
9
votes
1answer
222 views

Possible improvements to this Syracuse (3x+1)/2 graph?

This algorithm produces the Syracuse disjoint tree graph without any duplicates. No need for Union, For, and ...
5
votes
1answer
101 views

Efficiently find all connected subgraphs

Is there a way to generate all the connected subgraphs of a graph in mathematica without going through all the subsets of the nodes and checking if the subgraph is connected (which will be ...
1
vote
2answers
48 views

Avoiding overlap in rendering of GraphPlot

I'm trying to visualize some 'graphs' (i.e. the mathematical objects with nodes and edges) using GraphPlot[]. I am defining the nodes using objects such as ...
3
votes
0answers
30 views

VertexDelete not working on graph with VertexWeight

Good afternoon, I have observed an "unexpected behaviour" with VertexDelete and a graph with vertex weights. This is a minimal working example: OK ...
6
votes
1answer
69 views

Graph: Coloring Edges individually

CODE: Graph[{Style[0 -> 1, Red], Style[0 -> 1, {Blue, Dashed}]}] This mathematica code will make both lines solid Red, since they belong to the same two ...
5
votes
1answer
51 views

RandomGraph with specific constraints

I need to generate random connected simple graphs (no loops) with the constraint that exactly two vertices must only have a single edge. I can create many connected graphs (but very few will have the ...
0
votes
0answers
38 views

Create graph K5, delete 2 edges and 2 vertex, create adjacency matrix [duplicate]

I need help about this problem. I should create graph K5, delete 2 edges and 2 vertex from it and from the new graph create adjacency matrix. I have poor knowledge and i don't need anyone to solve the ...
2
votes
1answer
78 views

DeleteVertex in Kpartite graph

How can i make K7,2 graph and how can i delete 2 vertex? Btw, i need to use package -> Combinatorica`; I tried this: ...
2
votes
2answers
65 views

Graph not drawing after VertexDelete

I'm very new to Mathematica and am currently trying the VertexDelete function, but after using it, my graph isn't drawing. Input: ...
8
votes
1answer
191 views

Enforce graph symmetry

I am using ...
7
votes
1answer
69 views

Question about TransitiveReductionGraph

In Mathematica 10.0 and 10.1, according to the documentation of TransitiveReductionGraph: The transitive reduction h of a graph g is a graph that has the same ...
3
votes
1answer
69 views

How to use the edge routing of LayeredDigraphEmbedding when specifying explicit vertex coordinates?

The "LayeredDigraphEmbedding" GraphLayout uses an edge routing algorithm which produces nice and readable diagrams and curved ...
-2
votes
1answer
49 views

FindShortestPath does not work

The FindShortestPath doesn't work in this graph, can someone tel me what's wrong? ...
2
votes
1answer
87 views

How do I get the adjacency Matrix from a random graph [closed]

I am using the command g = RandomGraph[{8, 13}]; GraphPlot[g, VertexLabeling -> True] to plot a random graph with n nodes and l edges. Once the program has ...
2
votes
1answer
57 views

Efficient Implementation of Resistance Distance for graphs?

Is there an implementation of the resistance distance matrix (or just resistance matrix) for graphs available in Mathematica?
3
votes
1answer
114 views

Can I make a simple game in Mathematica?

Here is the game outline: $\hspace{2.5cm}$ There is one player. The player ($\mathscr{L}$) moves from node to node limited by the directed arrows. As the player moves, $\mathscr{G}_{\Huge\cdot}$ ...
2
votes
3answers
129 views

How to rotate a complete graph without image rescaling while rotating

How do I rotate the following image? ...
1
vote
1answer
66 views

Constructing an I-graph

I am attempting to build I-graphs in MMA, i.e. the non-Generalized Petersen graphs, and I found some code from Eric Weisstein, but this is now outdated and doesn't run. I have attempted to switch the ...
3
votes
2answers
170 views

Test if directed graph is connected

Is there a simple built-in way to check if a directed graph is connected? Now, before you throw ConnectedGraphQ or ...
0
votes
1answer
118 views

Displaying a bipartite graph in Wolfram Mathematica

Which is the function that can plot me the bipartite graph $K_{7, 2}$ in Mathematica? And after that to delete 2 edges?? Thanks for the help.
4
votes
1answer
70 views

Why are SetProperty and PropertyValue not working here?

I have a very simple graph, a loop: ...
5
votes
2answers
90 views

How to manipulate graphs without losing properties like EdgeWeight?

Let's say I have a weighted graph, ...
7
votes
3answers
378 views

How to remove all dead ends from a undirected graph?

so what I want to do is take an undirected graph, and remove all the "dead ends" (that is, vertices that are attached to only one other vertex), but do it in such a way that it does it until reaches ...
4
votes
2answers
131 views

Limit FindMinimumCostFlow function to one vertex per path

I want find a set of paths through a graph that maximise flow and minimise cost set on each Edge. However, I have an additional constraint where each Vertex can only be visited once. Mathematica has ...
0
votes
1answer
81 views

Cannot find a way to display an adjacency matrix [closed]

I have a question about face adjacency graphs. Suppose that I have an adjacency matrix How can I plot something like this?? I tried and it looks too messy. What may be the resulting graphic? Thank ...
1
vote
1answer
47 views

Graph Edit Distance with Mathematica?

Is there any way to calculate similarity of graphs or the graph edit distance in Mathematica ?
2
votes
0answers
35 views

Custom graph distribution

I am working with random graphs a lot. It's quite easy to describe random graph using, adjacency matrix or just a list of edges. However I am thinking that I might benefit from describing random ...
1
vote
1answer
65 views

Finding adjacency matrix of a Mathematica's in-built graph? [closed]

I want to get the adjacency matrix of an in-built graph, say the dodecahedral graph. Naively using AdjacencyMatrix[Dodecahedral] doesn't give it to me. Any ...