Halting behavior of optimal algorithms on getting enough input

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Per the advice in this comment, I am submitting this redraft of this question as a new question. This new question not only incorporates the five edits of the original question but also incorporates two more changes, identified with bold font to identify them.




I'll ask the question informally first and then try to work up to something more formal.



Consider a linear search problem. We are presented with an unsorted array of numbers and are asked to determine whether a certain number is in the array. There seems to be no better algorithm than to search linearly through the array, testing each array element in turn to see if it's equal to the test number. The point here is that if we do find it, we don't have to search any further.



The question is whether this is more generally true. For example, if we are asked to find a clique of size $k$ in a graph, we can quit once we find one, at least if we use the naive algorithm which simply checks each combination of vertices of size $k$. Does the optimal algorithm also halt when it has read enough of the input?



Let's try to formalize this. The model of computation we will use here is a Turing machine, with one tape and a fixed alphabet where the Turing machine alphabet $Sigma = 0,1$. This is to address potential applications of the linear speedup theorem. An input $i in 0,1^n$ is also just $n$ bits. Let's say fixed algorithms $A$ and $B$ compute a problem $P$, with $p$ an instance of $P$. Define $A$ as optimal if there is no $B$ with better time performance as defined below. We assume worst-case analysis until further clarifications are necessary.



New paragraph: for each problem $P$, we allow the input to be presented in the optimal order, that is, whatever order provides the best performance as defined below. This order is fixed, however, across algorithms implementing solutions to problem $P$.



Here's a formalization of the time performance optimality measure; it's modeled on big O but different. If $f$ and $g$ are two functions defined on the natural numbers, then we'll say $f(n) = Phi(g(n))$ if there is a constant $C$ such that



$$ f(n) < g(n) textrm for all n > C$$



Let's put some other constraints on $P$. Some instances $p$ can be solved by looking at a prefix $q$ of $i$, that is, $i=qw$ for some non-empty $w$. Will the optimal $A$ stop as soon as it has read and computed on $q$, or must it read $w$ as well?



Here's an alternative phrasing which describes the counterexample I'm looking for. The counterexample would exhibit a specific $P,A,p,i,q$ such that $A$ is an optimal algorithm for $P$ and $p$ is a specific instance describable with $i$ bits where even though $p$ can be solved based on $q$, algorithm $A$ nonetheless necessarily reads all of $i$ to solve its problem.










share|cite|improve this question





















  • I'm puzzled: One of your examples is the problem of finding a clique in a graph, and you point out that in the worst case, a brute-force algorithm will have to look at every possible set of vertices, and ask if this can be avoided. But your formalization is all about whether the algorithm must read the entire input. The input to the clique problem isn't a list of possible sets of vertices, it's a description of a graph, which is much shorter. It seems quite clear that no algorithm could possibly decide if a graph has a clique without seeing the entire graph, and so reading the entire input.
    – MJD
    Sep 6 at 12:20











  • @MJD: thanks for writing. My comment about the Clique problem was too brief. What I had in mind was the problem of finding a clique of a specific size. In this case, once the clique of the required size is found, the algorithm can stop since this is a monotone graph propery.
    – ShyPerson
    Sep 7 at 3:16











  • Regardless, it still must read the entire input. So your idea about probing whether instances can be solved after looking at only a prefix of the input is not going to yield any useful information.
    – MJD
    Sep 7 at 15:20










  • @MJD: Consider a complete graph with 10 nodes and the goal is to find a clique with 3 nodes. There are therefore $ beginpmatrix 10 \ 2 endpmatrix = 45 $ edges in the input graph. Now let's say we use an adjacency matrix in bits to represent this complete graph. When the first 3 edges are read in, these constitute a clique of size 3 since the input graph is complete. A clique has therefore been found after reading the first 3 bits of the adjacency matrix, not the whole thing. Am I missing something?
    – ShyPerson
    Sep 8 at 3:00










  • No, I understand now. Thanks for the example.
    – MJD
    Sep 8 at 7:57














up vote
0
down vote

favorite












Per the advice in this comment, I am submitting this redraft of this question as a new question. This new question not only incorporates the five edits of the original question but also incorporates two more changes, identified with bold font to identify them.




I'll ask the question informally first and then try to work up to something more formal.



Consider a linear search problem. We are presented with an unsorted array of numbers and are asked to determine whether a certain number is in the array. There seems to be no better algorithm than to search linearly through the array, testing each array element in turn to see if it's equal to the test number. The point here is that if we do find it, we don't have to search any further.



The question is whether this is more generally true. For example, if we are asked to find a clique of size $k$ in a graph, we can quit once we find one, at least if we use the naive algorithm which simply checks each combination of vertices of size $k$. Does the optimal algorithm also halt when it has read enough of the input?



Let's try to formalize this. The model of computation we will use here is a Turing machine, with one tape and a fixed alphabet where the Turing machine alphabet $Sigma = 0,1$. This is to address potential applications of the linear speedup theorem. An input $i in 0,1^n$ is also just $n$ bits. Let's say fixed algorithms $A$ and $B$ compute a problem $P$, with $p$ an instance of $P$. Define $A$ as optimal if there is no $B$ with better time performance as defined below. We assume worst-case analysis until further clarifications are necessary.



New paragraph: for each problem $P$, we allow the input to be presented in the optimal order, that is, whatever order provides the best performance as defined below. This order is fixed, however, across algorithms implementing solutions to problem $P$.



Here's a formalization of the time performance optimality measure; it's modeled on big O but different. If $f$ and $g$ are two functions defined on the natural numbers, then we'll say $f(n) = Phi(g(n))$ if there is a constant $C$ such that



$$ f(n) < g(n) textrm for all n > C$$



Let's put some other constraints on $P$. Some instances $p$ can be solved by looking at a prefix $q$ of $i$, that is, $i=qw$ for some non-empty $w$. Will the optimal $A$ stop as soon as it has read and computed on $q$, or must it read $w$ as well?



Here's an alternative phrasing which describes the counterexample I'm looking for. The counterexample would exhibit a specific $P,A,p,i,q$ such that $A$ is an optimal algorithm for $P$ and $p$ is a specific instance describable with $i$ bits where even though $p$ can be solved based on $q$, algorithm $A$ nonetheless necessarily reads all of $i$ to solve its problem.










share|cite|improve this question





















  • I'm puzzled: One of your examples is the problem of finding a clique in a graph, and you point out that in the worst case, a brute-force algorithm will have to look at every possible set of vertices, and ask if this can be avoided. But your formalization is all about whether the algorithm must read the entire input. The input to the clique problem isn't a list of possible sets of vertices, it's a description of a graph, which is much shorter. It seems quite clear that no algorithm could possibly decide if a graph has a clique without seeing the entire graph, and so reading the entire input.
    – MJD
    Sep 6 at 12:20











  • @MJD: thanks for writing. My comment about the Clique problem was too brief. What I had in mind was the problem of finding a clique of a specific size. In this case, once the clique of the required size is found, the algorithm can stop since this is a monotone graph propery.
    – ShyPerson
    Sep 7 at 3:16











  • Regardless, it still must read the entire input. So your idea about probing whether instances can be solved after looking at only a prefix of the input is not going to yield any useful information.
    – MJD
    Sep 7 at 15:20










  • @MJD: Consider a complete graph with 10 nodes and the goal is to find a clique with 3 nodes. There are therefore $ beginpmatrix 10 \ 2 endpmatrix = 45 $ edges in the input graph. Now let's say we use an adjacency matrix in bits to represent this complete graph. When the first 3 edges are read in, these constitute a clique of size 3 since the input graph is complete. A clique has therefore been found after reading the first 3 bits of the adjacency matrix, not the whole thing. Am I missing something?
    – ShyPerson
    Sep 8 at 3:00










  • No, I understand now. Thanks for the example.
    – MJD
    Sep 8 at 7:57












up vote
0
down vote

favorite









up vote
0
down vote

favorite











Per the advice in this comment, I am submitting this redraft of this question as a new question. This new question not only incorporates the five edits of the original question but also incorporates two more changes, identified with bold font to identify them.




I'll ask the question informally first and then try to work up to something more formal.



Consider a linear search problem. We are presented with an unsorted array of numbers and are asked to determine whether a certain number is in the array. There seems to be no better algorithm than to search linearly through the array, testing each array element in turn to see if it's equal to the test number. The point here is that if we do find it, we don't have to search any further.



The question is whether this is more generally true. For example, if we are asked to find a clique of size $k$ in a graph, we can quit once we find one, at least if we use the naive algorithm which simply checks each combination of vertices of size $k$. Does the optimal algorithm also halt when it has read enough of the input?



Let's try to formalize this. The model of computation we will use here is a Turing machine, with one tape and a fixed alphabet where the Turing machine alphabet $Sigma = 0,1$. This is to address potential applications of the linear speedup theorem. An input $i in 0,1^n$ is also just $n$ bits. Let's say fixed algorithms $A$ and $B$ compute a problem $P$, with $p$ an instance of $P$. Define $A$ as optimal if there is no $B$ with better time performance as defined below. We assume worst-case analysis until further clarifications are necessary.



New paragraph: for each problem $P$, we allow the input to be presented in the optimal order, that is, whatever order provides the best performance as defined below. This order is fixed, however, across algorithms implementing solutions to problem $P$.



Here's a formalization of the time performance optimality measure; it's modeled on big O but different. If $f$ and $g$ are two functions defined on the natural numbers, then we'll say $f(n) = Phi(g(n))$ if there is a constant $C$ such that



$$ f(n) < g(n) textrm for all n > C$$



Let's put some other constraints on $P$. Some instances $p$ can be solved by looking at a prefix $q$ of $i$, that is, $i=qw$ for some non-empty $w$. Will the optimal $A$ stop as soon as it has read and computed on $q$, or must it read $w$ as well?



Here's an alternative phrasing which describes the counterexample I'm looking for. The counterexample would exhibit a specific $P,A,p,i,q$ such that $A$ is an optimal algorithm for $P$ and $p$ is a specific instance describable with $i$ bits where even though $p$ can be solved based on $q$, algorithm $A$ nonetheless necessarily reads all of $i$ to solve its problem.










share|cite|improve this question













Per the advice in this comment, I am submitting this redraft of this question as a new question. This new question not only incorporates the five edits of the original question but also incorporates two more changes, identified with bold font to identify them.




I'll ask the question informally first and then try to work up to something more formal.



Consider a linear search problem. We are presented with an unsorted array of numbers and are asked to determine whether a certain number is in the array. There seems to be no better algorithm than to search linearly through the array, testing each array element in turn to see if it's equal to the test number. The point here is that if we do find it, we don't have to search any further.



The question is whether this is more generally true. For example, if we are asked to find a clique of size $k$ in a graph, we can quit once we find one, at least if we use the naive algorithm which simply checks each combination of vertices of size $k$. Does the optimal algorithm also halt when it has read enough of the input?



Let's try to formalize this. The model of computation we will use here is a Turing machine, with one tape and a fixed alphabet where the Turing machine alphabet $Sigma = 0,1$. This is to address potential applications of the linear speedup theorem. An input $i in 0,1^n$ is also just $n$ bits. Let's say fixed algorithms $A$ and $B$ compute a problem $P$, with $p$ an instance of $P$. Define $A$ as optimal if there is no $B$ with better time performance as defined below. We assume worst-case analysis until further clarifications are necessary.



New paragraph: for each problem $P$, we allow the input to be presented in the optimal order, that is, whatever order provides the best performance as defined below. This order is fixed, however, across algorithms implementing solutions to problem $P$.



Here's a formalization of the time performance optimality measure; it's modeled on big O but different. If $f$ and $g$ are two functions defined on the natural numbers, then we'll say $f(n) = Phi(g(n))$ if there is a constant $C$ such that



$$ f(n) < g(n) textrm for all n > C$$



Let's put some other constraints on $P$. Some instances $p$ can be solved by looking at a prefix $q$ of $i$, that is, $i=qw$ for some non-empty $w$. Will the optimal $A$ stop as soon as it has read and computed on $q$, or must it read $w$ as well?



Here's an alternative phrasing which describes the counterexample I'm looking for. The counterexample would exhibit a specific $P,A,p,i,q$ such that $A$ is an optimal algorithm for $P$ and $p$ is a specific instance describable with $i$ bits where even though $p$ can be solved based on $q$, algorithm $A$ nonetheless necessarily reads all of $i$ to solve its problem.







logic computer-science computational-complexity






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Sep 5 at 4:23









ShyPerson

975715




975715











  • I'm puzzled: One of your examples is the problem of finding a clique in a graph, and you point out that in the worst case, a brute-force algorithm will have to look at every possible set of vertices, and ask if this can be avoided. But your formalization is all about whether the algorithm must read the entire input. The input to the clique problem isn't a list of possible sets of vertices, it's a description of a graph, which is much shorter. It seems quite clear that no algorithm could possibly decide if a graph has a clique without seeing the entire graph, and so reading the entire input.
    – MJD
    Sep 6 at 12:20











  • @MJD: thanks for writing. My comment about the Clique problem was too brief. What I had in mind was the problem of finding a clique of a specific size. In this case, once the clique of the required size is found, the algorithm can stop since this is a monotone graph propery.
    – ShyPerson
    Sep 7 at 3:16











  • Regardless, it still must read the entire input. So your idea about probing whether instances can be solved after looking at only a prefix of the input is not going to yield any useful information.
    – MJD
    Sep 7 at 15:20










  • @MJD: Consider a complete graph with 10 nodes and the goal is to find a clique with 3 nodes. There are therefore $ beginpmatrix 10 \ 2 endpmatrix = 45 $ edges in the input graph. Now let's say we use an adjacency matrix in bits to represent this complete graph. When the first 3 edges are read in, these constitute a clique of size 3 since the input graph is complete. A clique has therefore been found after reading the first 3 bits of the adjacency matrix, not the whole thing. Am I missing something?
    – ShyPerson
    Sep 8 at 3:00










  • No, I understand now. Thanks for the example.
    – MJD
    Sep 8 at 7:57
















  • I'm puzzled: One of your examples is the problem of finding a clique in a graph, and you point out that in the worst case, a brute-force algorithm will have to look at every possible set of vertices, and ask if this can be avoided. But your formalization is all about whether the algorithm must read the entire input. The input to the clique problem isn't a list of possible sets of vertices, it's a description of a graph, which is much shorter. It seems quite clear that no algorithm could possibly decide if a graph has a clique without seeing the entire graph, and so reading the entire input.
    – MJD
    Sep 6 at 12:20











  • @MJD: thanks for writing. My comment about the Clique problem was too brief. What I had in mind was the problem of finding a clique of a specific size. In this case, once the clique of the required size is found, the algorithm can stop since this is a monotone graph propery.
    – ShyPerson
    Sep 7 at 3:16











  • Regardless, it still must read the entire input. So your idea about probing whether instances can be solved after looking at only a prefix of the input is not going to yield any useful information.
    – MJD
    Sep 7 at 15:20










  • @MJD: Consider a complete graph with 10 nodes and the goal is to find a clique with 3 nodes. There are therefore $ beginpmatrix 10 \ 2 endpmatrix = 45 $ edges in the input graph. Now let's say we use an adjacency matrix in bits to represent this complete graph. When the first 3 edges are read in, these constitute a clique of size 3 since the input graph is complete. A clique has therefore been found after reading the first 3 bits of the adjacency matrix, not the whole thing. Am I missing something?
    – ShyPerson
    Sep 8 at 3:00










  • No, I understand now. Thanks for the example.
    – MJD
    Sep 8 at 7:57















I'm puzzled: One of your examples is the problem of finding a clique in a graph, and you point out that in the worst case, a brute-force algorithm will have to look at every possible set of vertices, and ask if this can be avoided. But your formalization is all about whether the algorithm must read the entire input. The input to the clique problem isn't a list of possible sets of vertices, it's a description of a graph, which is much shorter. It seems quite clear that no algorithm could possibly decide if a graph has a clique without seeing the entire graph, and so reading the entire input.
– MJD
Sep 6 at 12:20





I'm puzzled: One of your examples is the problem of finding a clique in a graph, and you point out that in the worst case, a brute-force algorithm will have to look at every possible set of vertices, and ask if this can be avoided. But your formalization is all about whether the algorithm must read the entire input. The input to the clique problem isn't a list of possible sets of vertices, it's a description of a graph, which is much shorter. It seems quite clear that no algorithm could possibly decide if a graph has a clique without seeing the entire graph, and so reading the entire input.
– MJD
Sep 6 at 12:20













@MJD: thanks for writing. My comment about the Clique problem was too brief. What I had in mind was the problem of finding a clique of a specific size. In this case, once the clique of the required size is found, the algorithm can stop since this is a monotone graph propery.
– ShyPerson
Sep 7 at 3:16





@MJD: thanks for writing. My comment about the Clique problem was too brief. What I had in mind was the problem of finding a clique of a specific size. In this case, once the clique of the required size is found, the algorithm can stop since this is a monotone graph propery.
– ShyPerson
Sep 7 at 3:16













Regardless, it still must read the entire input. So your idea about probing whether instances can be solved after looking at only a prefix of the input is not going to yield any useful information.
– MJD
Sep 7 at 15:20




Regardless, it still must read the entire input. So your idea about probing whether instances can be solved after looking at only a prefix of the input is not going to yield any useful information.
– MJD
Sep 7 at 15:20












@MJD: Consider a complete graph with 10 nodes and the goal is to find a clique with 3 nodes. There are therefore $ beginpmatrix 10 \ 2 endpmatrix = 45 $ edges in the input graph. Now let's say we use an adjacency matrix in bits to represent this complete graph. When the first 3 edges are read in, these constitute a clique of size 3 since the input graph is complete. A clique has therefore been found after reading the first 3 bits of the adjacency matrix, not the whole thing. Am I missing something?
– ShyPerson
Sep 8 at 3:00




@MJD: Consider a complete graph with 10 nodes and the goal is to find a clique with 3 nodes. There are therefore $ beginpmatrix 10 \ 2 endpmatrix = 45 $ edges in the input graph. Now let's say we use an adjacency matrix in bits to represent this complete graph. When the first 3 edges are read in, these constitute a clique of size 3 since the input graph is complete. A clique has therefore been found after reading the first 3 bits of the adjacency matrix, not the whole thing. Am I missing something?
– ShyPerson
Sep 8 at 3:00












No, I understand now. Thanks for the example.
– MJD
Sep 8 at 7:57




No, I understand now. Thanks for the example.
– MJD
Sep 8 at 7:57















active

oldest

votes











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',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2905870%2fhalting-behavior-of-optimal-algorithms-on-getting-enough-input%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2905870%2fhalting-behavior-of-optimal-algorithms-on-getting-enough-input%23new-answer', 'question_page');

);

Post as a guest













































































這個網誌中的熱門文章

tkz-euclide: tkzDrawCircle[R] not working

How to combine Bézier curves to a surface?

1st Magritte Awards