mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 09:28:26 +08:00
24 lines
514 B
JavaScript
24 lines
514 B
JavaScript
import { mColoring } from '../MColoringProblem'
|
|
|
|
describe('MColoringProblem', () => {
|
|
it('should color a triangle with 3 colors', () => {
|
|
const graph = [
|
|
[0, 1, 1],
|
|
[1, 0, 1],
|
|
[1, 1, 0]
|
|
]
|
|
const solution = mColoring(graph, 3)
|
|
expect(solution).not.toBeNull()
|
|
})
|
|
|
|
it('should not color a triangle with 2 colors', () => {
|
|
const graph = [
|
|
[0, 1, 1],
|
|
[1, 0, 1],
|
|
[1, 1, 0]
|
|
]
|
|
const solution = mColoring(graph, 2)
|
|
expect(solution).toBeNull()
|
|
})
|
|
})
|