NL - iterating all edges of a graph in log spaceSpace bounded Turing Machine - clarification on Computational Complexity (book: Arora-Barak ) question 4.1Show that k-clique lies in LP, NP and specialised Turing MachinesLooking for an example of proving space upper bounds for computing functions on a DTMCovering a graph with non-overlapping cliquesHow to use succinct circuits to construct an EXPTIME complete problem?Why L is defined as L = SPACE$( log n)$ instead of L = SPACE$(log^2 n)$ or L = SPACE$(sqrt n)$?Meaning of $NL$ Complexity ClassThere are parsimonious reductions between all NP-Complete problems: Well-known conjecture?Constructing a DFA $M$ such that $L(M) = L(A) bigtriangleup L(B)$ with a kind of log-space TM

Oil draining out shortly after turbo hose detached/broke

How much web presence should I have?

Playing a trill with grace note ending

When to use и or а as “and”?

Why vspace-lineskip removes space after tikz picture although it stands before the picture?

DateTime.addMonths skips a month (from feb to mar)

Should I list a completely different profession in my technical resume?

Parsing text written the millitext font

How to represent jealousy in a cute way?

Dedicated bike GPS computer over smartphone

Does it make sense to use a wavelet that is equal to a sine of one period?

Was planting UN flag on Moon ever discussed?

How to generate list of *all* available commands and functions?

Why does there seem to be an extreme lack of public trashcans in Taiwan?

That's not my X, its Y is too Z

How can powerful telekinesis avoid violating Newton's 3rd Law?

How do I avoid typing "git" at the begining of every Git command?

Do Veracrypt encrypted volumes have any kind of brute force protection?

Are the guests in Westworld forbidden to tell the hosts that they are robots?

What exactly "triggers an additional time" in the interaction between Afterlife and Teysa Karlov?

How can I list the different hex characters between two files?

If the pressure inside and outside a balloon balance, then why does air leave when it pops?

How do I type a hyphen in iOS 12?

C++ logging library



NL - iterating all edges of a graph in log space


Space bounded Turing Machine - clarification on Computational Complexity (book: Arora-Barak ) question 4.1Show that k-clique lies in LP, NP and specialised Turing MachinesLooking for an example of proving space upper bounds for computing functions on a DTMCovering a graph with non-overlapping cliquesHow to use succinct circuits to construct an EXPTIME complete problem?Why L is defined as L = SPACE$( log n)$ instead of L = SPACE$(log^2 n)$ or L = SPACE$(sqrt n)$?Meaning of $NL$ Complexity ClassThere are parsimonious reductions between all NP-Complete problems: Well-known conjecture?Constructing a DFA $M$ such that $L(M) = L(A) bigtriangleup L(B)$ with a kind of log-space TM













4












$begingroup$


Given a turing machine which has logrtmic space, and consists of an input tape and a working tape, Is it possible to iterate all egdes of an input graph? I know the answer is probably NO, because clique and other similer NP problems belongs to NP and not to NL. Unfortunately, I can't find a satisfying and clear explanation to that fact. Can some one make it more clear for me?










share|cite|improve this question









$endgroup$
















    4












    $begingroup$


    Given a turing machine which has logrtmic space, and consists of an input tape and a working tape, Is it possible to iterate all egdes of an input graph? I know the answer is probably NO, because clique and other similer NP problems belongs to NP and not to NL. Unfortunately, I can't find a satisfying and clear explanation to that fact. Can some one make it more clear for me?










    share|cite|improve this question









    $endgroup$














      4












      4








      4





      $begingroup$


      Given a turing machine which has logrtmic space, and consists of an input tape and a working tape, Is it possible to iterate all egdes of an input graph? I know the answer is probably NO, because clique and other similer NP problems belongs to NP and not to NL. Unfortunately, I can't find a satisfying and clear explanation to that fact. Can some one make it more clear for me?










      share|cite|improve this question









      $endgroup$




      Given a turing machine which has logrtmic space, and consists of an input tape and a working tape, Is it possible to iterate all egdes of an input graph? I know the answer is probably NO, because clique and other similer NP problems belongs to NP and not to NL. Unfortunately, I can't find a satisfying and clear explanation to that fact. Can some one make it more clear for me?







      complexity-theory graph-theory






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked May 27 at 19:39









      LioHLioH

      805




      805




















          2 Answers
          2






          active

          oldest

          votes


















          5












          $begingroup$

          There's absolutely no problem to iterate over all edges in a graph in logspace (even deterministic logspace!). The details depend on how the graph is encoded. For example, if the graph is encoded as an adjacency matrix, then you can simply go over all pairs of vertices.



          However, this doesn't give an NL algorithm for clique. The problem is that you need to iterate on $k$-tuples of vertices, for non-constant $k$. This is something you cannot do in logspace.



          NP is sometimes described in terms of witnesses. However, the "official" definitions is using nondeterministic Turing machines, which are allowed to have more than one correct move at any given point in time. The class of languages accepted by nondeterministic polytime Turing machines coincides with the class of languages which are given a polynomial size witness and can verify it in polynomial time. Unfortunately, there is no such alternative description for nondeterministic logspace Turing machines.






          share|cite|improve this answer











          $endgroup$












          • $begingroup$
            Oh, I see. But if a graph G, and a witness set of vertices U, are available on the input tape and we just need to verify U, is it not possible to just Iterate on all pairs of vertices (in U) and check (in G) that all corresponding edges exists? And therefore - verify a clique in logspace?
            $endgroup$
            – LioH
            May 27 at 20:58










          • $begingroup$
            A nondeterministic Turing machine can make nondeterministic moves – in other words, make a guess – and then verify it. But it doesn't get a witness as an input. It turns out that NP can be equivalently defined in terms of witnesses, but this equivalence breaks for NL.
            $endgroup$
            – Yuval Filmus
            May 27 at 21:08










          • $begingroup$
            Now I got it. I was mistakenly thinking the "witnesses definition" can also be applied to NL. Thank you!
            $endgroup$
            – LioH
            May 27 at 21:24










          • $begingroup$
            I think you can have a witness based definition for NL. The only difference would be that you have read-only one-way access to the witness tape. (Since we're talking about logspace machines, we have to be careful about the access model to polynomial-sized strings.)
            $endgroup$
            – Robin Kothari
            May 28 at 5:43











          • $begingroup$
            Right, good point.
            $endgroup$
            – Yuval Filmus
            May 28 at 6:25


















          3












          $begingroup$

          You can iterate over the edges of a graph in logarithmic space, since all that is required in order to do so is a counter up to the number of edges. Note that the hardness of clique and other hard problems in NP does not lie in simple iteration, but in detecting different structures in your input which are not apparent (e.g. a clique of a large enough size).



          Additionally, languages decidable by Turing machines which are not able to read the entire input are decidable in constant time, so not being able to iterate over the entire input is not interesting in the standard Turing machine model (as opposed to random access).






          share|cite|improve this answer









          $endgroup$













            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "419"
            ;
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f109944%2fnl-iterating-all-edges-of-a-graph-in-log-space%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            5












            $begingroup$

            There's absolutely no problem to iterate over all edges in a graph in logspace (even deterministic logspace!). The details depend on how the graph is encoded. For example, if the graph is encoded as an adjacency matrix, then you can simply go over all pairs of vertices.



            However, this doesn't give an NL algorithm for clique. The problem is that you need to iterate on $k$-tuples of vertices, for non-constant $k$. This is something you cannot do in logspace.



            NP is sometimes described in terms of witnesses. However, the "official" definitions is using nondeterministic Turing machines, which are allowed to have more than one correct move at any given point in time. The class of languages accepted by nondeterministic polytime Turing machines coincides with the class of languages which are given a polynomial size witness and can verify it in polynomial time. Unfortunately, there is no such alternative description for nondeterministic logspace Turing machines.






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              Oh, I see. But if a graph G, and a witness set of vertices U, are available on the input tape and we just need to verify U, is it not possible to just Iterate on all pairs of vertices (in U) and check (in G) that all corresponding edges exists? And therefore - verify a clique in logspace?
              $endgroup$
              – LioH
              May 27 at 20:58










            • $begingroup$
              A nondeterministic Turing machine can make nondeterministic moves – in other words, make a guess – and then verify it. But it doesn't get a witness as an input. It turns out that NP can be equivalently defined in terms of witnesses, but this equivalence breaks for NL.
              $endgroup$
              – Yuval Filmus
              May 27 at 21:08










            • $begingroup$
              Now I got it. I was mistakenly thinking the "witnesses definition" can also be applied to NL. Thank you!
              $endgroup$
              – LioH
              May 27 at 21:24










            • $begingroup$
              I think you can have a witness based definition for NL. The only difference would be that you have read-only one-way access to the witness tape. (Since we're talking about logspace machines, we have to be careful about the access model to polynomial-sized strings.)
              $endgroup$
              – Robin Kothari
              May 28 at 5:43











            • $begingroup$
              Right, good point.
              $endgroup$
              – Yuval Filmus
              May 28 at 6:25















            5












            $begingroup$

            There's absolutely no problem to iterate over all edges in a graph in logspace (even deterministic logspace!). The details depend on how the graph is encoded. For example, if the graph is encoded as an adjacency matrix, then you can simply go over all pairs of vertices.



            However, this doesn't give an NL algorithm for clique. The problem is that you need to iterate on $k$-tuples of vertices, for non-constant $k$. This is something you cannot do in logspace.



            NP is sometimes described in terms of witnesses. However, the "official" definitions is using nondeterministic Turing machines, which are allowed to have more than one correct move at any given point in time. The class of languages accepted by nondeterministic polytime Turing machines coincides with the class of languages which are given a polynomial size witness and can verify it in polynomial time. Unfortunately, there is no such alternative description for nondeterministic logspace Turing machines.






            share|cite|improve this answer











            $endgroup$












            • $begingroup$
              Oh, I see. But if a graph G, and a witness set of vertices U, are available on the input tape and we just need to verify U, is it not possible to just Iterate on all pairs of vertices (in U) and check (in G) that all corresponding edges exists? And therefore - verify a clique in logspace?
              $endgroup$
              – LioH
              May 27 at 20:58










            • $begingroup$
              A nondeterministic Turing machine can make nondeterministic moves – in other words, make a guess – and then verify it. But it doesn't get a witness as an input. It turns out that NP can be equivalently defined in terms of witnesses, but this equivalence breaks for NL.
              $endgroup$
              – Yuval Filmus
              May 27 at 21:08










            • $begingroup$
              Now I got it. I was mistakenly thinking the "witnesses definition" can also be applied to NL. Thank you!
              $endgroup$
              – LioH
              May 27 at 21:24










            • $begingroup$
              I think you can have a witness based definition for NL. The only difference would be that you have read-only one-way access to the witness tape. (Since we're talking about logspace machines, we have to be careful about the access model to polynomial-sized strings.)
              $endgroup$
              – Robin Kothari
              May 28 at 5:43











            • $begingroup$
              Right, good point.
              $endgroup$
              – Yuval Filmus
              May 28 at 6:25













            5












            5








            5





            $begingroup$

            There's absolutely no problem to iterate over all edges in a graph in logspace (even deterministic logspace!). The details depend on how the graph is encoded. For example, if the graph is encoded as an adjacency matrix, then you can simply go over all pairs of vertices.



            However, this doesn't give an NL algorithm for clique. The problem is that you need to iterate on $k$-tuples of vertices, for non-constant $k$. This is something you cannot do in logspace.



            NP is sometimes described in terms of witnesses. However, the "official" definitions is using nondeterministic Turing machines, which are allowed to have more than one correct move at any given point in time. The class of languages accepted by nondeterministic polytime Turing machines coincides with the class of languages which are given a polynomial size witness and can verify it in polynomial time. Unfortunately, there is no such alternative description for nondeterministic logspace Turing machines.






            share|cite|improve this answer











            $endgroup$



            There's absolutely no problem to iterate over all edges in a graph in logspace (even deterministic logspace!). The details depend on how the graph is encoded. For example, if the graph is encoded as an adjacency matrix, then you can simply go over all pairs of vertices.



            However, this doesn't give an NL algorithm for clique. The problem is that you need to iterate on $k$-tuples of vertices, for non-constant $k$. This is something you cannot do in logspace.



            NP is sometimes described in terms of witnesses. However, the "official" definitions is using nondeterministic Turing machines, which are allowed to have more than one correct move at any given point in time. The class of languages accepted by nondeterministic polytime Turing machines coincides with the class of languages which are given a polynomial size witness and can verify it in polynomial time. Unfortunately, there is no such alternative description for nondeterministic logspace Turing machines.







            share|cite|improve this answer














            share|cite|improve this answer



            share|cite|improve this answer








            edited May 27 at 21:11

























            answered May 27 at 20:10









            Yuval FilmusYuval Filmus

            201k15196359




            201k15196359











            • $begingroup$
              Oh, I see. But if a graph G, and a witness set of vertices U, are available on the input tape and we just need to verify U, is it not possible to just Iterate on all pairs of vertices (in U) and check (in G) that all corresponding edges exists? And therefore - verify a clique in logspace?
              $endgroup$
              – LioH
              May 27 at 20:58










            • $begingroup$
              A nondeterministic Turing machine can make nondeterministic moves – in other words, make a guess – and then verify it. But it doesn't get a witness as an input. It turns out that NP can be equivalently defined in terms of witnesses, but this equivalence breaks for NL.
              $endgroup$
              – Yuval Filmus
              May 27 at 21:08










            • $begingroup$
              Now I got it. I was mistakenly thinking the "witnesses definition" can also be applied to NL. Thank you!
              $endgroup$
              – LioH
              May 27 at 21:24










            • $begingroup$
              I think you can have a witness based definition for NL. The only difference would be that you have read-only one-way access to the witness tape. (Since we're talking about logspace machines, we have to be careful about the access model to polynomial-sized strings.)
              $endgroup$
              – Robin Kothari
              May 28 at 5:43











            • $begingroup$
              Right, good point.
              $endgroup$
              – Yuval Filmus
              May 28 at 6:25
















            • $begingroup$
              Oh, I see. But if a graph G, and a witness set of vertices U, are available on the input tape and we just need to verify U, is it not possible to just Iterate on all pairs of vertices (in U) and check (in G) that all corresponding edges exists? And therefore - verify a clique in logspace?
              $endgroup$
              – LioH
              May 27 at 20:58










            • $begingroup$
              A nondeterministic Turing machine can make nondeterministic moves – in other words, make a guess – and then verify it. But it doesn't get a witness as an input. It turns out that NP can be equivalently defined in terms of witnesses, but this equivalence breaks for NL.
              $endgroup$
              – Yuval Filmus
              May 27 at 21:08










            • $begingroup$
              Now I got it. I was mistakenly thinking the "witnesses definition" can also be applied to NL. Thank you!
              $endgroup$
              – LioH
              May 27 at 21:24










            • $begingroup$
              I think you can have a witness based definition for NL. The only difference would be that you have read-only one-way access to the witness tape. (Since we're talking about logspace machines, we have to be careful about the access model to polynomial-sized strings.)
              $endgroup$
              – Robin Kothari
              May 28 at 5:43











            • $begingroup$
              Right, good point.
              $endgroup$
              – Yuval Filmus
              May 28 at 6:25















            $begingroup$
            Oh, I see. But if a graph G, and a witness set of vertices U, are available on the input tape and we just need to verify U, is it not possible to just Iterate on all pairs of vertices (in U) and check (in G) that all corresponding edges exists? And therefore - verify a clique in logspace?
            $endgroup$
            – LioH
            May 27 at 20:58




            $begingroup$
            Oh, I see. But if a graph G, and a witness set of vertices U, are available on the input tape and we just need to verify U, is it not possible to just Iterate on all pairs of vertices (in U) and check (in G) that all corresponding edges exists? And therefore - verify a clique in logspace?
            $endgroup$
            – LioH
            May 27 at 20:58












            $begingroup$
            A nondeterministic Turing machine can make nondeterministic moves – in other words, make a guess – and then verify it. But it doesn't get a witness as an input. It turns out that NP can be equivalently defined in terms of witnesses, but this equivalence breaks for NL.
            $endgroup$
            – Yuval Filmus
            May 27 at 21:08




            $begingroup$
            A nondeterministic Turing machine can make nondeterministic moves – in other words, make a guess – and then verify it. But it doesn't get a witness as an input. It turns out that NP can be equivalently defined in terms of witnesses, but this equivalence breaks for NL.
            $endgroup$
            – Yuval Filmus
            May 27 at 21:08












            $begingroup$
            Now I got it. I was mistakenly thinking the "witnesses definition" can also be applied to NL. Thank you!
            $endgroup$
            – LioH
            May 27 at 21:24




            $begingroup$
            Now I got it. I was mistakenly thinking the "witnesses definition" can also be applied to NL. Thank you!
            $endgroup$
            – LioH
            May 27 at 21:24












            $begingroup$
            I think you can have a witness based definition for NL. The only difference would be that you have read-only one-way access to the witness tape. (Since we're talking about logspace machines, we have to be careful about the access model to polynomial-sized strings.)
            $endgroup$
            – Robin Kothari
            May 28 at 5:43





            $begingroup$
            I think you can have a witness based definition for NL. The only difference would be that you have read-only one-way access to the witness tape. (Since we're talking about logspace machines, we have to be careful about the access model to polynomial-sized strings.)
            $endgroup$
            – Robin Kothari
            May 28 at 5:43













            $begingroup$
            Right, good point.
            $endgroup$
            – Yuval Filmus
            May 28 at 6:25




            $begingroup$
            Right, good point.
            $endgroup$
            – Yuval Filmus
            May 28 at 6:25











            3












            $begingroup$

            You can iterate over the edges of a graph in logarithmic space, since all that is required in order to do so is a counter up to the number of edges. Note that the hardness of clique and other hard problems in NP does not lie in simple iteration, but in detecting different structures in your input which are not apparent (e.g. a clique of a large enough size).



            Additionally, languages decidable by Turing machines which are not able to read the entire input are decidable in constant time, so not being able to iterate over the entire input is not interesting in the standard Turing machine model (as opposed to random access).






            share|cite|improve this answer









            $endgroup$

















              3












              $begingroup$

              You can iterate over the edges of a graph in logarithmic space, since all that is required in order to do so is a counter up to the number of edges. Note that the hardness of clique and other hard problems in NP does not lie in simple iteration, but in detecting different structures in your input which are not apparent (e.g. a clique of a large enough size).



              Additionally, languages decidable by Turing machines which are not able to read the entire input are decidable in constant time, so not being able to iterate over the entire input is not interesting in the standard Turing machine model (as opposed to random access).






              share|cite|improve this answer









              $endgroup$















                3












                3








                3





                $begingroup$

                You can iterate over the edges of a graph in logarithmic space, since all that is required in order to do so is a counter up to the number of edges. Note that the hardness of clique and other hard problems in NP does not lie in simple iteration, but in detecting different structures in your input which are not apparent (e.g. a clique of a large enough size).



                Additionally, languages decidable by Turing machines which are not able to read the entire input are decidable in constant time, so not being able to iterate over the entire input is not interesting in the standard Turing machine model (as opposed to random access).






                share|cite|improve this answer









                $endgroup$



                You can iterate over the edges of a graph in logarithmic space, since all that is required in order to do so is a counter up to the number of edges. Note that the hardness of clique and other hard problems in NP does not lie in simple iteration, but in detecting different structures in your input which are not apparent (e.g. a clique of a large enough size).



                Additionally, languages decidable by Turing machines which are not able to read the entire input are decidable in constant time, so not being able to iterate over the entire input is not interesting in the standard Turing machine model (as opposed to random access).







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered May 27 at 20:10









                ArielAriel

                10.7k11433




                10.7k11433



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Computer Science 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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f109944%2fnl-iterating-all-edges-of-a-graph-in-log-space%23new-answer', 'question_page');

                    );

                    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







                    Popular posts from this blog

                    Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                    Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                    What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company