graph-coloring

Greedy algorithm: Interval coloring

让人想犯罪 __ 提交于 2019-12-23 11:57:06
问题 In interval scheduling, the algorithm is to pick the earliest finish time. But in interval colouring the former does not work. Is there an example or explanation on why picking earliest finish time won't work for interval colouring? The interval colouring problem is: 
given
 a 
set 
of 
intervals,
 we 
want 
to 
colour all
 intervals
 so 
that 
intervals
 given
 the
 same
 colour
 do 
not 
intersect
 and 
the
goal
 is 
to 
try 
to
 minimize 
the 
number 
of 
colours 
used. This can be thought

Greedy algorithm: Interval coloring

有些话、适合烂在心里 提交于 2019-12-23 11:56:16
问题 In interval scheduling, the algorithm is to pick the earliest finish time. But in interval colouring the former does not work. Is there an example or explanation on why picking earliest finish time won't work for interval colouring? The interval colouring problem is: 
given
 a 
set 
of 
intervals,
 we 
want 
to 
colour all
 intervals
 so 
that 
intervals
 given
 the
 same
 colour
 do 
not 
intersect
 and 
the
goal
 is 
to 
try 
to
 minimize 
the 
number 
of 
colours 
used. This can be thought

Graph Coloring with using Simulated Annealing

浪尽此生 提交于 2019-12-22 13:58:51
问题 I am trying to come up with the algorithm for a Graph Coloring problem using Simulated Annealing. There is the general algorithm online, but when i look at it, I couldn't understand how can apply this algorithm on this problem. Each node in graph must had diffrent color from it's neibours. How can I use the Simulated annealing algorithm for this. What is the "temperature", "schedule" in this problem? Please help me understand this. Thanks 回答1: Setting the starting temperature and cooling

R networkD3 custom node color for radialNetwork()

一个人想着一个人 提交于 2019-12-11 17:25:18
问题 The R package networkD3 provides an interface for R users to make network plots in D3, but the input data and ability to map data to network aesthetics differs over the available plots (e.g., simpleNetwork, forceNetwork). Recently I've been trying to apply custom colors to each node in a radialNetwork(), similar to this thread, but I can't figure out how the custom coloring was mapped to the nodes. The code to produce a custom coloring: library(networkD3) library(tidyverse) library(data.tree)

Graph Coloring with using Simulated Annealing

こ雲淡風輕ζ 提交于 2019-12-06 05:34:31
I am trying to come up with the algorithm for a Graph Coloring problem using Simulated Annealing. There is the general algorithm online, but when i look at it, I couldn't understand how can apply this algorithm on this problem. Each node in graph must had diffrent color from it's neibours. How can I use the Simulated annealing algorithm for this. What is the "temperature", "schedule" in this problem? Please help me understand this. Thanks Setting the starting temperature and cooling scheduling parameters correctly is a pain, because you need to have a good value for both before you get a good

Finding minimum cost in a binary matrix

◇◆丶佛笑我妖孽 提交于 2019-11-30 00:00:11
Consider a n * n binary matrix. Each cell of this matrix has at most 4 neighbors (if it exists). We call two cells of this matrix incompatible if they are neighbors and their values are not equal. We pay $b for each incompatible pair. Also we can change the value of the cell with paying $a. The question is to find the minimum cost for this matrix. I already used backtracking and found an algorithm of O(2 ^ (n * n)) . Can someone help me find a more efficient algorithm? This idea is due to Greig, Porteous, and Seheult. Treat the matrix as a capacitated directed graph with vertices corresponding

Finding minimum cost in a binary matrix

半世苍凉 提交于 2019-11-28 20:36:14
问题 Consider a n * n binary matrix. Each cell of this matrix has at most 4 neighbors (if it exists). We call two cells of this matrix incompatible if they are neighbors and their values are not equal. We pay $b for each incompatible pair. Also we can change the value of the cell with paying $a. The question is to find the minimum cost for this matrix. I already used backtracking and found an algorithm of O(2 ^ (n * n)) . Can someone help me find a more efficient algorithm? 回答1: This idea is due