In graph theory, a complete graph is one in which there is an edge between each pair of distinct nodes.

USING: kernel math.combinatorics math.parser sequences
graphviz graphviz.notation graphviz.render ;
: K_n ( n -- )
<graph>
[node "point" =shape ];
[graph "t" =labelloc "circo" =layout ];
over number>string "K " prepend =label
swap <iota> 2 [ first2 add-edge ] each-combination
preview ;

5 K_n

6 K_n

7 K_n

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.100 x86.64 (2264, heads/master-a743826db8, Apr 9 2024 19:44:18)