DFS - comparing the time and score complexity of two connected graph

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











up vote
0
down vote

favorite












Imagine a two-layered course graph, which upper level presents an acyclic directed graph with n nodes, while the lower level presents an acyclic directed graph with m nodes. Each node in the upper level is connected to a few nodes in the lower level (let's say each node in the upper level covers a few nodes in the lower level). So n is less than m (each node in upper level at least covers 2 nodes in lower level).



My questions are:



1- What are the time and space complexities using the depth-first search algorithm to find all sequences from a certain node in the upper level and in the lower level? and how these time and space complexity of two levels can be compared (how they are related)?



My answer about time and score complexities, which I am suspicious about, are as follow:



  • Upper level:time complexity:o(n), space complexity: o(n+e) (e: number
    of edges).

  • Lower level:time complexity:o(m), space complexity: o(m+e)
    (e: number of edges).

But I can not find the relation among these two.



2- If we want to find all possible sequences from a single node in the lower level of the graph, if an additional node will be added to this graph, how the number of sequences increases (for the worst case scenario)?



Any idea is appreciated!










share|cite|improve this question

























    up vote
    0
    down vote

    favorite












    Imagine a two-layered course graph, which upper level presents an acyclic directed graph with n nodes, while the lower level presents an acyclic directed graph with m nodes. Each node in the upper level is connected to a few nodes in the lower level (let's say each node in the upper level covers a few nodes in the lower level). So n is less than m (each node in upper level at least covers 2 nodes in lower level).



    My questions are:



    1- What are the time and space complexities using the depth-first search algorithm to find all sequences from a certain node in the upper level and in the lower level? and how these time and space complexity of two levels can be compared (how they are related)?



    My answer about time and score complexities, which I am suspicious about, are as follow:



    • Upper level:time complexity:o(n), space complexity: o(n+e) (e: number
      of edges).

    • Lower level:time complexity:o(m), space complexity: o(m+e)
      (e: number of edges).

    But I can not find the relation among these two.



    2- If we want to find all possible sequences from a single node in the lower level of the graph, if an additional node will be added to this graph, how the number of sequences increases (for the worst case scenario)?



    Any idea is appreciated!










    share|cite|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Imagine a two-layered course graph, which upper level presents an acyclic directed graph with n nodes, while the lower level presents an acyclic directed graph with m nodes. Each node in the upper level is connected to a few nodes in the lower level (let's say each node in the upper level covers a few nodes in the lower level). So n is less than m (each node in upper level at least covers 2 nodes in lower level).



      My questions are:



      1- What are the time and space complexities using the depth-first search algorithm to find all sequences from a certain node in the upper level and in the lower level? and how these time and space complexity of two levels can be compared (how they are related)?



      My answer about time and score complexities, which I am suspicious about, are as follow:



      • Upper level:time complexity:o(n), space complexity: o(n+e) (e: number
        of edges).

      • Lower level:time complexity:o(m), space complexity: o(m+e)
        (e: number of edges).

      But I can not find the relation among these two.



      2- If we want to find all possible sequences from a single node in the lower level of the graph, if an additional node will be added to this graph, how the number of sequences increases (for the worst case scenario)?



      Any idea is appreciated!










      share|cite|improve this question













      Imagine a two-layered course graph, which upper level presents an acyclic directed graph with n nodes, while the lower level presents an acyclic directed graph with m nodes. Each node in the upper level is connected to a few nodes in the lower level (let's say each node in the upper level covers a few nodes in the lower level). So n is less than m (each node in upper level at least covers 2 nodes in lower level).



      My questions are:



      1- What are the time and space complexities using the depth-first search algorithm to find all sequences from a certain node in the upper level and in the lower level? and how these time and space complexity of two levels can be compared (how they are related)?



      My answer about time and score complexities, which I am suspicious about, are as follow:



      • Upper level:time complexity:o(n), space complexity: o(n+e) (e: number
        of edges).

      • Lower level:time complexity:o(m), space complexity: o(m+e)
        (e: number of edges).

      But I can not find the relation among these two.



      2- If we want to find all possible sequences from a single node in the lower level of the graph, if an additional node will be added to this graph, how the number of sequences increases (for the worst case scenario)?



      Any idea is appreciated!







      graph-theory graphing-functions 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 9:43









      user3233712

      11




      11

























          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%2f2906081%2fdfs-comparing-the-time-and-score-complexity-of-two-connected-graph%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%2f2906081%2fdfs-comparing-the-time-and-score-complexity-of-two-connected-graph%23new-answer', 'question_page');

          );

          Post as a guest













































































          這個網誌中的熱門文章

          How to combine Bézier curves to a surface?

          Mutual Information Always Non-negative

          Why am i infinitely getting the same tweet with the Twitter Search API?