1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/get_cmty_fast_greedy.R
3\name{get_cmty_fast_greedy}
4\alias{get_cmty_fast_greedy}
5\title{Get community membership by modularity optimization}
6\usage{
7get_cmty_fast_greedy(graph)
8}
9\arguments{
10\item{graph}{A graph object of class \code{dgr_graph}.}
11}
12\value{
13a data frame with group membership assignments for each of the nodes.
14}
15\description{
16Through the use of greedy optimization of a modularity score, obtain the
17group membership values for each of the nodes in the graph. Note that this
18method only works on graphs without multiple edges.
19}
20\examples{
21# Create a graph with a
22# balanced tree
23graph <-
24  create_graph() \%>\%
25  add_balanced_tree(
26    k = 2,
27    h = 2)
28
29# Get the group membership
30# values for all nodes in
31# the graph through the greedy
32# optimization of modularity
33# algorithm
34graph \%>\%
35  get_cmty_fast_greedy()
36
37# Add the group membership
38# values to the graph as a
39# node attribute
40graph <-
41  graph \%>\%
42  join_node_attrs(
43    df = get_cmty_fast_greedy(.))
44
45# Display the graph's
46# node data frame
47graph \%>\% get_node_df()
48
49}
50