Files
JavaScript/Backtracking/tests/MColoringProblem.test.js
2023-10-28 10:53:43 +05:30

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()
})
})