Description Usage Arguments Functions Examples
These functions are tidygraph
wrapper around the various graph coloring algorithms.
They automatically use the graph that is being computed on, and
otherwise passes on its arguments to the relevant coloring function. The return value is always
a integer vector of assigned color index so that neighboring nodes never share the same color.
1 2 3 4 5 6 7 8 9 10 11 | color_dsatur()
color_msc()
color_lmxrlf()
color_hybrid_lmxrlf_tabucol()
color_hybrid_dsatur_tabucol()
color_tabucol(k, tabu_size = 25, rep = 100, nbmax = 1000)
|
k |
number of colors to use for graph coloring |
tabu_size |
size of tabu list |
rep |
number of inner iterations |
nbmax |
maximum number of non-improving outer iterations |
color_dsatur
: Color graph using graph_coloring_dsatur()
color_msc
: Color graph using graph_coloring_msc()
color_lmxrlf
: Color graph using graph_coloring_lmxrlf()
WARNING Algorithm is unstable and requires additional testing
color_hybrid_lmxrlf_tabucol
: Color graph using graph_coloring_hybrid_lmxrlf_tabucol()
WARNING Algorithm is unstable and requires additional testing
color_hybrid_dsatur_tabucol
: Color graph using graph_coloring_hybrid_dsatur_tabucol()
color_tabucol
: Color graph using graph_coloring_tabucol()
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(tidygraph)
if (requireNamespace("ggraph", quietly = TRUE)) {
library(ggraph)
set.seed(42)
play_islands(5, 10, 0.8, 3) %>%
mutate(color = as.factor(color_dsatur())) %>%
ggraph(layout = 'kk') +
geom_edge_link(aes(alpha = ..index..), show.legend = FALSE) +
geom_node_point(aes(color = color), size = 7) +
theme_graph("")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.