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)

8
votes
1answer
442 views

Why does SocialMediaData return such a small FollowerNetwork?

I have hooked up my Twitter account to Mathematica and I have 1468 followers myfollowers = Length[SocialMediaData["Twitter", "Followers"]] 1468 I wondered what ...
10
votes
2answers
723 views

Combinatorica package and graph-theoretical issues

I've searched for a solution to my problem a couple of days, and I didn't find one. Hope you guys can help me. I'm currently trying to solve some graph-theoretical problems. One of them is to find ...
6
votes
4answers
2k views

How to generate and draw simple bipartite graphs?

A bipartite graph is a graph whose vertices can be divided into two disjoint sets. Given two lists: {1, 2, 3} and {x, y, z}, ...
1
vote
2answers
144 views

Error changing edge thickness in a GraphPlot

I'm having some problems with the Mathematica graphics inspector. I want to make a graph with the following code: ...
4
votes
3answers
598 views

How to find all graph isomorphisms in FindGraphIsomorphism

I found the second definition of the function FindGraphIsomorphism not working. Here's the definition Mathematica 8 gives: ...
8
votes
2answers
433 views

Extracting vertex coordinates from an automatically laid out graph

Given a Graph with an automatically computed layout (i.e. not explicitly given VertexCoordinates, but using a ...
10
votes
2answers
265 views

Why is NeighborhoodGraph so slow?

To get neighboring vertices I first tried: gg = GridGraph[{10, 10, 10, 10}]; VertexList[NeighborhoodGraph[gg, 1, 1]] // AbsoluteTiming {5.539308, {1, 2, 11, ...
24
votes
1answer
543 views

Reduce distances between vertices of graph to minimum possible?

This simple graph has vertex shapes of different sizes: ...
5
votes
1answer
362 views

Accessing the graph Thinning produces without losing all the edges' lengths/slopes

This is a follow up to the OCR question I had earlier. What I want to do is to use Thinning to create "skeletons" of images of characters and then compare their shapes, utilizing such properties ...
9
votes
1answer
142 views

Algorithm used by IsomorphicGraphQ

I'd like to know which algorithm is used to test if two graphs are isomorphic?
2
votes
0answers
193 views

How can I compute the chromatic index and number of a graph?

I saw a recent question from M.R. and realized there is no function to compute the chromatic index and number of a graph, other than a really slow method in the now deprecated Combinatorica. So, how ...
3
votes
2answers
248 views

Deleting a row or column of an adjacency matrix while maintaining the associated label

I am currently working with a weighted adjacency matrix for a directed graph, and it contains several 0 columns and rows. With the unaltered matrix, I am able to monitor the relations between vertices ...
1
vote
1answer
585 views

Using singular value decomposition for graph clustering

I have a fairly large graph (50-60 vertices) with directed, weighted edges, and I am attempting to cluster the vertices. Prior to this, I have only worked with undirected graphs having symmetric ...
3
votes
2answers
216 views

TreePlot EdgeLabeling Style

I am trying to control the style for edge labels in treeplot and have run into a problem. Consider these two graphs: ...
6
votes
1answer
649 views

Ordering vertices with minimum Edge Crossing in Circular Graphs

Weighted and sorted Mathematica circular graphs are shown below. My question is how to reorder the vertices in such a way that they have minimum cuts (intersection of edges) while keeping the circular ...
2
votes
1answer
250 views

Speed up iterated manipulations of a graph / table

I am trying to generate a version of Watts' model of cascading shocks to a network following the discussion on p. 20-25 of this article. The basic premise is to use the ...
14
votes
2answers
531 views

How can I speed up the classic GA for graph coloring?

I'm trying to compute the chromatic number of this graph (which is 28): g = Import@"http://www.info.univ-angers.fr/pub/porumbel/graphs/dsjc250.5.col"; My genetic ...
1
vote
1answer
193 views

Problem setting up edge rendering function

I have a graph, and I want my EdgeRenderingFunction to colour the edges based on the vertex they originate from. In this toy example, I'm trying to get the edge ...
7
votes
2answers
356 views

Can I put tooltips in a Graph?

This doesn't work: Is there a way to do this? My real goal is to identify the second links in the graph below, which shows the results of a webcrawl (using this code). I'm open to another ...
1
vote
1answer
175 views

EdgeRenderingFunction and Graph input output structure

I am trying to create an EdgeRenderingFunction but the more information does not help me at all as far as explaining what the ...
2
votes
1answer
242 views

Changing some stuff to Kruskal's Algorithm

I'm trying to modify this algorithm: http://demonstrations.wolfram.com/ConnectingTownsUsingKruskalsAlgorithm/ The thing is that I want to receive a Graph (declared outside, with all its vertex, edges ...
8
votes
1answer
734 views

How to speed up Minimum Spanning Tree algorithm?

How to speed up MST algorithm? I work with graphs and I have adopted Prim's algorithm for my needs, from here. The graphs which I use are very dense (number of vertexes: $V=500$ and every vertex is ...
4
votes
0answers
366 views

Finding a Graph Shortest Path with Custom Graph Distance Function

What is the best way to find a shortest path by using a custom distance function? I'm trying to play a little bit with the concept of using distributions instead of a deterministic weight value for ...
2
votes
1answer
274 views

Isomorphisms for graphs with loops and multiple edges

I am working with graphs with multiple edges and loops, and I want to eliminate all isomorphic graphs from a long list I've generated. The FindGraphIsomorphism ...
4
votes
1answer
454 views

(Efficiently) Generating graphs with vertex degree 3 for all vertices

I'm working on a graph theory problem, and given $n$ vertices, I would like to be able to generate all non-isomorphic connected graphs (not necessarily simple) with $n$ vertices, each having degree 3. ...
5
votes
4answers
2k views

How to generate random directed connected graph?

How to generate random directed connected graph? I need to create graph which will pass: ConnectedGraphQ[^]
6
votes
1answer
310 views

Interactive Graph Editing with Animation

I want to make a simple interactive user interface like this: Such that when the user clicks on the "Add Edge" button, the edge specified by from and to fiels is added to the graph. The new graph ...
4
votes
1answer
681 views

Creating a weighted, directed graph from ordered triples

I have a relatively large set of data that I am trying to turn into a weighted, directed graph. The data concerns the inflow of migrants based on country of origin. I currently have three columns of ...
9
votes
2answers
299 views

Transition between graphs

I want to visually demonstrate the manipulations made to a graph. For instance, I have a graph g where using the command ...
3
votes
2answers
217 views

Showing a forest with root of the trees on the top

I have a Graph object that contains a forest with directed trees. I want to draw the forest such that the root of the trees are on the top and the leaves are on the bottom. If I use the following line ...
6
votes
2answers
1k views

Eigenvalue / Eigenvector Calculation

I'm currently trying to compute the three smallest eigenvectors for a 34 by 34 matrix. While I was expecting this to take some time, Mathematica has been running for the past 3 hours, which seems ...
7
votes
1answer
303 views

How to implement hive plot for graphs in Mathematica?

I'm trying to implement a version of the hive plot advocated in [Kryzywinski, et al., 2012]. There are many examples of such graphs on the author's webpage. It would be good enough for me to have ...
20
votes
2answers
3k views

How to play with Facebook data inside Mathematica?

I saw this post from Wolfram here and I would like to know how to import facebook data into Mathematica.
21
votes
3answers
2k views

How to generate a random tree?

Is it possible to generate a random tree without explicitly constructing a random adjacency matrix that satisfies tree properties? How about a random directed tree? Edit: incredible answer by ...
29
votes
5answers
6k views

Custom arrow shaft

Inspired by Sjoerd C. de Vries' nice answer to this question, and the desire to pimp a Graph I did with Mathematica recently I would like to know if there are ways to customize the arrow's shaft ...
13
votes
1answer
351 views

Transform an expression into a graph that can be plotted with TreeGraph (not TreeForm)

I would like to plot an expression (like TreeForm does), but using the new TreeGraph functionality. ...
6
votes
2answers
198 views

How to make each node of a graph a button?

A newbie question this one - MMA help seems to suggest it would be possible to place a button on ( or have a button be ) each node of graph, labelled with the name of said node. I have no idea where ...
3
votes
1answer
387 views

Control over depth-first scan and breadth-first scan

Is there a way to conditionally take control/modify the flow during a depth-first scan or the breadth-first scan ? Say, for example, if a particular node if found, consider it as a leaf-node and ...
4
votes
3answers
495 views

Place graph vertex labels in circles

Consider the following code: ...
5
votes
2answers
346 views

Merging (combining) tables of graph relationships (2-mode to 1-mode network)

I have some data of corporate board members in Australia in excel format here (Dropbox public link). It is the data behind this graph. The first worksheet is of all the vertexes (directors and ...
12
votes
1answer
185 views

Layout a second graph of the same nodes in the same way

I have a number of graphs with the same nodes. I would like to be able to somehow save the layout that results from the spring embedded results of one graph (the first image), and have the other ...
12
votes
2answers
475 views

Calculating morphometric properties

Is it possible to calculate segment length, segment diameter and branch angles for three dimensional geometry. Geometry contains vertex points and polygon surfaces as ...
14
votes
2answers
592 views

How to measure segment length and branch angle

I am trying to measure segment length and branch angle or bifurcation angle between each pair of segments. My image after thinning looks like this: ...
13
votes
1answer
583 views

Use Mathematica to do a network analysis of Mathematica.SE

Recently Wolfram|Alpha announced that you could use it to analyze your Facebook site. How could I do a network analysis of questioners and answers here on Mathematica.SE?
10
votes
4answers
548 views

Ordering vertices in GraphPlot

I'm new here, so forgive me if this question is not well-posed/duplicates an earlier question - although I've searched for similar questions without success. I'm trying to present a plot of ...
3
votes
1answer
177 views

Labeled and Graph don't mix?

In an attempt to create a legend for a graph drawing, I find that Labeled only works without the position options (except for Center). ...
13
votes
1answer
449 views

Visiting nodes in a tree bottom up

I have a problem that can be reduced to this one: Suppose I have an unbalanced (almost random) tree. The leaves of the tree have one property already set, and all vertex (including the leaves) have ...
10
votes
1answer
433 views

Drawing dessins d'enfants (bipartite graphs subject to certain conditions)

I want to write a function which constructs all possible dessins d'enfants (bipartite graphs fulfilling certain criteria, given below) from a collection of data presented in the following form: ...
1
vote
1answer
143 views

Community structure algorithm [closed]

I'm using CommunityStructureAssginment[] from GraphUtilities but not sure what is the algorithm behind it. May be someone knows what is the algorithm? Or any info on the community structure ...