Dynamic visualization of graphs using d3.js

Brian Granger and Jon Frederic.

Visualizing integer factoring

In this example, we visualize the factoring of small integers. We use a simple algorithm:

  • For a given integer find all of its divisors in increasing order: $10 \rightarrow 2, 5$
  • For all of those divisors recursively find their divisors
  • Continue until all of the divisors are prime
  • Nodes in the graph are the divisors
  • Edges are added between an integer and each of its divisors
In [1]:
from intfact import factorizer