21
$\begingroup$

Q: What is the best way to obtain the math.SE network whose edges are linked questions?

I.e., the network whose nodes are the

318,363 questions

on the site and we have an undirected edge from node A to node B whenever A links to B?


An example of what we see when a question is linked to another question:

An example of a linked question

and the linked question is linked back (hence undirected edges).

This is mostly out of curiosity: it would be interesting to see how this network is evolving over time.

| |
$\endgroup$
  • 2
    $\begingroup$ This is a great question, and I think I'm going to see if maybe I can do something with this. $\endgroup$ – davidlowryduda Aug 31 '14 at 2:31
  • 1
    $\begingroup$ Oh, but I didn't answer your question. This data is all in the SO data dumps - you just have to sift through it well enough. This information is also on the site itself, but following those links too quickly would perturb people, I think. $\endgroup$ – davidlowryduda Aug 31 '14 at 2:36
  • 2
    $\begingroup$ By the way, the edges are directed internally (in PostLinks table): question with PostId is the one that contains a link to question with RelatedPostId. When rendering the sidebar, the system looks up both directions. $\endgroup$ – user147263 Aug 31 '14 at 4:01
15
$\begingroup$

The data is contained in the PostLinks table, accessible through Data Explorer. I wrote a simple query Post Links. Since the table has more than $50000$ rows, it cannot be retrieved by SEDE at once. But one can limit the query by MinId, MaxId, download and merge the results. I think two tries will be enough: the query succeeds with MinId=1 and MaxId=500000, another grab with MinId=500001 and MaxId=1000000 should do the job.

You can also download the data dump, as mixedmath said; though the Data Explorer is more up to date.

SEDE bug

Unfortunately, right now you can't download the results of the above query as CSV file: this is a bug that will be squashed with the next redeploy of SEDE.

Fortunately, the bug affects only the queries with parameters. Using the queries

one can get all the links. In fact, the first one gets almost all the results; only a relatively small piece of the second CSV file needs to be added to it.

Most linked questions

I don't expect the graph of linked questions to have interesting structure: it probably consists of a large number of small components, most of which are two-vertex components. It is of some interest to see which questions are linked most often, but the site already shows that.

The current record is $105$ links, held by How can I evaluate $\sum_{n=0}^\infty (n+1)x^n$.

| |
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .