CLUSTER(1)

πŸ“¦
version 16.1.0 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– CLUSTER(1) πŸ’–

okay bestie, welcome to the cluster manual page, from the General Commands Manual section, no less. she's a little program that looks at your graph and goes "hmm. who's in whose friend group?" β€” and then she writes that info right back into your graph. iconic behaviour honestly.


✨ NAME ✨

cluster β€” find clusters in a graph and augment the graph with this information.

like. that's the whole job. find the friend groups, label the friend groups, move on. πŸ’…


🌸 SYNOPSIS 🌸

cluster [-v?]  [ -Ck ] [ -ck ] [ -o outfile ] [ files ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so cluster takes a graph in DOT format as input, finds the node clusters in it, and then augments the graph with that info. she doesn't just tell you about the clusters β€” she writes them into the graph. main character energy.

the clusters are specified by the "cluster" attribute attached to nodes, and cluster values are non-negative integers. cluster attempts to maximize the modularity of the clustering. (modularity = how good the groupings are, basically, it's giving "are these actual cliques or are we just guessing".)

oh and β€” if the edge attribute "weight" is defined, that gets used in computing the clustering. so yes, your weights matter, bestie. don't skip them. 🫢


πŸ’… OPTIONS πŸ’…

the following options are supported:

  • -Ck β€” specifies a targeted number of clusters that should be generated. and like, listen: the number k you give is only a suggestion and may not be realisable. if k == 0 (which is the default), you get the number of clusters that approximately optimizes the modularity. so she'll do the math herself.
  • -ck β€” specifies the clustering method. if k == 0, the default, modularity clustering will be used. if k == 1, modularity quality will be used.
  • -ooutfile β€” specifies that output should go into the file outfile. by default, stdout is used.
  • -v β€” verbose mode. she will talk. a lot. πŸ’¬
  • -? β€” prints the usage and exits. (she's had enough.)

πŸ”₯ EXAMPLES πŸ”₯

applying cluster to the following graph,

graph {
    1--2 [weight=10.]
    2--3 [weight=1]
    3--4 [weight=10.]
    4--5 [weight=10]
    5--6 [weight=10]
    3--6 [weight=0.1]
    4--6 [weight=10.]
   }

gives

graph {
      node [cluster="-1"];
      1 [cluster=1];
      2 [cluster=1];
      3 [cluster=2];
      4 [cluster=2];
      5 [cluster=2];
      6 [cluster=2];
      1 -- 2 [weight="10."];
      2 -- 3 [weight=1];
      3 -- 4 [weight="10."];
      4 -- 5 [weight=10];
      5 -- 6 [weight=10];
      3 -- 6 [weight="0.1"];
      4 -- 6 [weight="10."];
}

see that? {1, 2} became one cluster and {3, 4, 5, 6} became another, the default node [cluster="-1"] got dropped in at the top, and she rewrote all your weights as strings. ate. πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Yifan Hu <yifanhu@yahoo.com>


🌈 SEE ALSO 🌈

  • gvmap(1)
  • Blondel, V.D., Guillaume, J.L., Lambiotte, R., Lefebvre, E.: Fast unfolding of communities in large networks. Journal of Statistical Mechanics: Theory and Experiment (2008), P10008.

ngl that paper is literally where this whole modularity-clustering vibe comes from. iykyk. πŸ“šβœ¨

and that's the whole page, babe β€” this one's from the General Commands Manual, dated 3 March 2011, and it's literally called CLUSTER(1). periodt. πŸ’œπŸŽ€

πŸ“¦ where this page comes from