Show that the 3-color problem is in P when the input graph is a tree.
This one is from university assignment. I am completely stuck on this one and I searched the internet but couldn't find a explanation.
Show that the 3-color problem is in P when the input graph is a tree.
Any explanation would be appreciated.
graph-theory computational-complexity coloring np-complete
add a comment |
This one is from university assignment. I am completely stuck on this one and I searched the internet but couldn't find a explanation.
Show that the 3-color problem is in P when the input graph is a tree.
Any explanation would be appreciated.
graph-theory computational-complexity coloring np-complete
2
Every tree is $2$-colorable, so I'm not quite getting the question.
– Cheerful Parsnip
Nov 29 at 21:09
yeah I know but thats what the question states. I have no clue.
– semal259
Nov 29 at 21:11
add a comment |
This one is from university assignment. I am completely stuck on this one and I searched the internet but couldn't find a explanation.
Show that the 3-color problem is in P when the input graph is a tree.
Any explanation would be appreciated.
graph-theory computational-complexity coloring np-complete
This one is from university assignment. I am completely stuck on this one and I searched the internet but couldn't find a explanation.
Show that the 3-color problem is in P when the input graph is a tree.
Any explanation would be appreciated.
graph-theory computational-complexity coloring np-complete
graph-theory computational-complexity coloring np-complete
edited Nov 29 at 21:41
gt6989b
33k22452
33k22452
asked Nov 29 at 21:06
semal259
31
31
2
Every tree is $2$-colorable, so I'm not quite getting the question.
– Cheerful Parsnip
Nov 29 at 21:09
yeah I know but thats what the question states. I have no clue.
– semal259
Nov 29 at 21:11
add a comment |
2
Every tree is $2$-colorable, so I'm not quite getting the question.
– Cheerful Parsnip
Nov 29 at 21:09
yeah I know but thats what the question states. I have no clue.
– semal259
Nov 29 at 21:11
2
2
Every tree is $2$-colorable, so I'm not quite getting the question.
– Cheerful Parsnip
Nov 29 at 21:09
Every tree is $2$-colorable, so I'm not quite getting the question.
– Cheerful Parsnip
Nov 29 at 21:09
yeah I know but thats what the question states. I have no clue.
– semal259
Nov 29 at 21:11
yeah I know but thats what the question states. I have no clue.
– semal259
Nov 29 at 21:11
add a comment |
1 Answer
1
active
oldest
votes
UPDATED following a suggestion in the comments.
- Validate that the input is a tree
- Answer "yes"
Both (1) and (2) are doable in polynomial time (how?) so this is in $P$
Does this prove that 3-color is in P? 2-coloring can be done by BFS and tree is a bipartite by definition. But what about 3-color?
– semal259
Nov 29 at 21:33
@semal259 any 2-coloring is also a 3-coloring, so it does indeed prove that 3-coloring a tree is in $P$
– gt6989b
Nov 29 at 21:40
1
One could argue that it's even simpler than this, since the $2$-color problem should have a yes/no answer. Just write a program that always produces the answer yes (possibly after verifying that the input is a tree.)
– Cheerful Parsnip
Nov 29 at 21:41
@CheerfulParsnip :-) +1, funny, yes, definitely
– gt6989b
Nov 29 at 21:43
1
@semal259 Indeed, a tree is $k$-colorable in polynomial time for all $k ge 2$.
– gt6989b
Nov 29 at 21:47
|
show 2 more comments
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3019221%2fshow-that-the-3-color-problem-is-in-p-when-the-input-graph-is-a-tree%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
UPDATED following a suggestion in the comments.
- Validate that the input is a tree
- Answer "yes"
Both (1) and (2) are doable in polynomial time (how?) so this is in $P$
Does this prove that 3-color is in P? 2-coloring can be done by BFS and tree is a bipartite by definition. But what about 3-color?
– semal259
Nov 29 at 21:33
@semal259 any 2-coloring is also a 3-coloring, so it does indeed prove that 3-coloring a tree is in $P$
– gt6989b
Nov 29 at 21:40
1
One could argue that it's even simpler than this, since the $2$-color problem should have a yes/no answer. Just write a program that always produces the answer yes (possibly after verifying that the input is a tree.)
– Cheerful Parsnip
Nov 29 at 21:41
@CheerfulParsnip :-) +1, funny, yes, definitely
– gt6989b
Nov 29 at 21:43
1
@semal259 Indeed, a tree is $k$-colorable in polynomial time for all $k ge 2$.
– gt6989b
Nov 29 at 21:47
|
show 2 more comments
UPDATED following a suggestion in the comments.
- Validate that the input is a tree
- Answer "yes"
Both (1) and (2) are doable in polynomial time (how?) so this is in $P$
Does this prove that 3-color is in P? 2-coloring can be done by BFS and tree is a bipartite by definition. But what about 3-color?
– semal259
Nov 29 at 21:33
@semal259 any 2-coloring is also a 3-coloring, so it does indeed prove that 3-coloring a tree is in $P$
– gt6989b
Nov 29 at 21:40
1
One could argue that it's even simpler than this, since the $2$-color problem should have a yes/no answer. Just write a program that always produces the answer yes (possibly after verifying that the input is a tree.)
– Cheerful Parsnip
Nov 29 at 21:41
@CheerfulParsnip :-) +1, funny, yes, definitely
– gt6989b
Nov 29 at 21:43
1
@semal259 Indeed, a tree is $k$-colorable in polynomial time for all $k ge 2$.
– gt6989b
Nov 29 at 21:47
|
show 2 more comments
UPDATED following a suggestion in the comments.
- Validate that the input is a tree
- Answer "yes"
Both (1) and (2) are doable in polynomial time (how?) so this is in $P$
UPDATED following a suggestion in the comments.
- Validate that the input is a tree
- Answer "yes"
Both (1) and (2) are doable in polynomial time (how?) so this is in $P$
edited Nov 29 at 21:43
answered Nov 29 at 21:27
gt6989b
33k22452
33k22452
Does this prove that 3-color is in P? 2-coloring can be done by BFS and tree is a bipartite by definition. But what about 3-color?
– semal259
Nov 29 at 21:33
@semal259 any 2-coloring is also a 3-coloring, so it does indeed prove that 3-coloring a tree is in $P$
– gt6989b
Nov 29 at 21:40
1
One could argue that it's even simpler than this, since the $2$-color problem should have a yes/no answer. Just write a program that always produces the answer yes (possibly after verifying that the input is a tree.)
– Cheerful Parsnip
Nov 29 at 21:41
@CheerfulParsnip :-) +1, funny, yes, definitely
– gt6989b
Nov 29 at 21:43
1
@semal259 Indeed, a tree is $k$-colorable in polynomial time for all $k ge 2$.
– gt6989b
Nov 29 at 21:47
|
show 2 more comments
Does this prove that 3-color is in P? 2-coloring can be done by BFS and tree is a bipartite by definition. But what about 3-color?
– semal259
Nov 29 at 21:33
@semal259 any 2-coloring is also a 3-coloring, so it does indeed prove that 3-coloring a tree is in $P$
– gt6989b
Nov 29 at 21:40
1
One could argue that it's even simpler than this, since the $2$-color problem should have a yes/no answer. Just write a program that always produces the answer yes (possibly after verifying that the input is a tree.)
– Cheerful Parsnip
Nov 29 at 21:41
@CheerfulParsnip :-) +1, funny, yes, definitely
– gt6989b
Nov 29 at 21:43
1
@semal259 Indeed, a tree is $k$-colorable in polynomial time for all $k ge 2$.
– gt6989b
Nov 29 at 21:47
Does this prove that 3-color is in P? 2-coloring can be done by BFS and tree is a bipartite by definition. But what about 3-color?
– semal259
Nov 29 at 21:33
Does this prove that 3-color is in P? 2-coloring can be done by BFS and tree is a bipartite by definition. But what about 3-color?
– semal259
Nov 29 at 21:33
@semal259 any 2-coloring is also a 3-coloring, so it does indeed prove that 3-coloring a tree is in $P$
– gt6989b
Nov 29 at 21:40
@semal259 any 2-coloring is also a 3-coloring, so it does indeed prove that 3-coloring a tree is in $P$
– gt6989b
Nov 29 at 21:40
1
1
One could argue that it's even simpler than this, since the $2$-color problem should have a yes/no answer. Just write a program that always produces the answer yes (possibly after verifying that the input is a tree.)
– Cheerful Parsnip
Nov 29 at 21:41
One could argue that it's even simpler than this, since the $2$-color problem should have a yes/no answer. Just write a program that always produces the answer yes (possibly after verifying that the input is a tree.)
– Cheerful Parsnip
Nov 29 at 21:41
@CheerfulParsnip :-) +1, funny, yes, definitely
– gt6989b
Nov 29 at 21:43
@CheerfulParsnip :-) +1, funny, yes, definitely
– gt6989b
Nov 29 at 21:43
1
1
@semal259 Indeed, a tree is $k$-colorable in polynomial time for all $k ge 2$.
– gt6989b
Nov 29 at 21:47
@semal259 Indeed, a tree is $k$-colorable in polynomial time for all $k ge 2$.
– gt6989b
Nov 29 at 21:47
|
show 2 more comments
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3019221%2fshow-that-the-3-color-problem-is-in-p-when-the-input-graph-is-a-tree%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Every tree is $2$-colorable, so I'm not quite getting the question.
– Cheerful Parsnip
Nov 29 at 21:09
yeah I know but thats what the question states. I have no clue.
– semal259
Nov 29 at 21:11