The first 1000 primes with modulo PrimesGraph_1.pngedges can be assembled like so:

PrimesGraph_2.gif

The standard base-2 graph looks like the following:

PrimesGraph_3.png

PrimesGraph_4.gif

PrimesGraph_5.png

The base-n graphs for n=2,..,100

PrimesGraph_6.gif

PrimesGraph_7.gif

It seems the odd values gives a connected graph except for N=2:

PrimesGraph_8.png

PrimesGraph_9.png

The diameter is obviously ∞ for odd values:

PrimesGraph_10.png

PrimesGraph_11.png

If we take the odd ones only and skip the N=2 exception:

PrimesGraph_12.png

PrimesGraph_13.png

Let’s create an association for this:

PrimesGraph_14.gif

PrimesGraph_15.png

Can something be learned here?

PrimesGraph_16.png

PrimesGraph_17.gif

Let’s create a test set:

PrimesGraph_18.gif

PrimesGraph_19.png

PrimesGraph_20.png

PrimesGraph_21.png

That’s not encouraging. The classifier actually is a simple block function as can be seen from

PrimesGraph_22.png

PrimesGraph_23.gif

How does it look visually?

PrimesGraph_24.png

PrimesGraph_25.gif

PrimesGraph_26.png

Graphics:Graph diameter for N<200

Prime base

What about using prime bases? The first 100 primes:

PrimesGraph_28.png

Here again, only N=2 stands out:

PrimesGraph_29.png

PrimesGraph_30.png

More visually:

PrimesGraph_31.png

PrimesGraph_32.gif

This is equivalent to looking at the graph diameter:

PrimesGraph_33.png

PrimesGraph_34.png

Since it looks so binary, let’s omit the first anomaly and see what number this produces:

PrimesGraph_35.png

PrimesGraph_36.png

PrimesGraph_37.png

PrimesGraph_38.png

Link prediction

PrimesGraph_39.png

PrimesGraph_40.png

There seems have be some convergence and bands or levels:

PrimesGraph_41.png

PrimesGraph_42.gif

PrimesGraph_43.png

Because of the sparseness we sample in the first 100 primes:

PrimesGraph_44.gif

PrimesGraph_45.png

Even all of this leads to a highly imbalanced set to train.

PrimesGraph_46.gif

So, have to approach it differently. Let’s take a positive set:

PrimesGraph_47.png

PrimesGraph_48.png

and a negative set:

PrimesGraph_49.png

PrimesGraph_50.png

Let’s combine this into a function:

PrimesGraph_51.png

Now we can generate arbitrary datasets for training and testing:

PrimesGraph_52.gif

PrimesGraph_53.png

PrimesGraph_54.gif

PrimesGraph_55.png

PrimesGraph_56.gif

PrimesGraph_57.png

PrimesGraph_58.png

PrimesGraph_59.png

PrimesGraph_60.png

PrimesGraph_61.gif

PrimesGraph_62.png

PrimesGraph_63.png

PrimesGraph_64.png

PrimesGraph_65.png

PrimesGraph_66.png

PrimesGraph_67.png

Created with the Wolfram Language