DFS - comparing the time and score complexity of two connected graph
Clash 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!
graph-theory graphing-functions computational-complexity
add a comment |Â
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!
graph-theory graphing-functions computational-complexity
add a comment |Â
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!
graph-theory graphing-functions computational-complexity
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
graph-theory graphing-functions computational-complexity
asked Sep 5 at 9:43
user3233712
11
11
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
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
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
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
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