text
stringlengths
81
47k
source
stringlengths
59
147
Question: <p>Consider an undirected graph <span class="math-container">$G$</span>. A subset <span class="math-container">$S \subseteq V(G)$</span> is n-dependent if for every <span class="math-container">$x \in S, d_{&lt;S&gt;}(x) \leq n-1$</span>. The n-dependence number of <span class="math-container">$G$</span>, den...
https://cs.stackexchange.com/questions/132334/proof-that-n-dependent-set-in-graph-theory-is-np-complete
Question: <p>What is the difference between graph-partitioning and graph-clustering in graph theory?</p> Answer: <p>Graph partitioning and graph clustering are informal concepts, which (usually) mean partitioning the vertex set under some constraints (for example, the number of parts) such that some objective function...
https://cs.stackexchange.com/questions/54683/difference-between-graph-partitioning-and-graph-clustering
Question: <p>The following question is from the book "Introduction to Algorithms" By Cormen and three other authors.</p> <p>$26.2-10$<br> Show how to find a maximum flow in a network $G = (V,E)$ by a sequence of at most $|E|$ augmenting paths. (Hint: Determine the paths after finding the maximum flow.)</p> <p>I find ...
https://cs.stackexchange.com/questions/88899/a-question-about-a-question-related-to-graph-theory-and-maximum-flow
Question: <p>I would like to ask this question as I am not sure about the answer.</p> <p>Let <span class="math-container">$G=(V,E)$</span> be a connected, undirected graph, and let <span class="math-container">$x,y\in V$</span> be two different vertices. Let <span class="math-container">$A$</span> be the problem of fin...
https://cs.stackexchange.com/questions/155295/a-question-about-the-graph-theory-or-data-structure-and-algorithms
Question: <p>Say for example I'd like to state that there exists a pair of vertices such that they form an edge in one graph but not some other graph. I'd go about it as follows:</p> <p><span class="math-container">$$ \exists u, v \in V, (u,v) \in G, (u,v) \not\in H $$</span></p> <p>My main question here is: Is my use ...
https://cs.stackexchange.com/questions/157369/what-is-the-proper-way-to-write-logic-formula-say-concerning-graph-theory
Question: <p>I was going through the concept of graphs as matroids and I came upon the rank of a graph. Wikipedia lists it as <span class="math-container">$n - c$</span>, <span class="math-container">$n = |V|$</span>, <span class="math-container">$c =$</span> # of connected components.</p> <p>I do understand rank and n...
https://cs.stackexchange.com/questions/150541/rank-of-a-graph-in-matroid-theory
Question: <p>I am referencing some code I found on GeeksForGeeks.com: Why is the current node printed (and processed) first before its children are processed? Wouldn't "breadth first" mean "Process children first, then process parent"? or, is that only for Trees? I can't be the only one to not understand this, so inste...
https://cs.stackexchange.com/questions/117964/graph-theory-bfs-breadth-first-search-why-is-current-processed-first
Question: <p>Suppose I have $M=\{1,\ldots, n\}$ men and $W = \{1, \ldots, n\}$ women and $B =\{1, \ldots, m\}$ brokers, such that each broker knows a subset of $M \times W$ and for each pair in this subset a marriage can be set up among the corresponding man and women.</p> <p>Each broker $i$ can set up a maximum of $b...
https://cs.stackexchange.com/questions/33569/formulate-the-marriage-problem-into-a-maximum-flow-problem-graph-theory
Question: <p>I've seen the topic of the automorphism group appear in several introductory graph theory books I've looked at. It always feel oddly disjointed and poorly motivated to me.</p> <p>Is there any practical (or impractical for that matter) applications of knowing the automorphism group of a graph?</p> Answer:...
https://cs.stackexchange.com/questions/65391/applications-of-graph-automorphisms
Question: <p>Set theory depends on a set membership function <span class="math-container">$\epsilon$</span> which is a class of ordered pairs. Is it possible to construct <em>the ordered pair</em> from an undirected graph of <em>unordered pairs</em>? Alternatively, is there a way to construct a undirected graph that ...
https://cs.stackexchange.com/questions/151497/using-an-undirected-graph-to-represent-an-ordered-pair
Question: <p>I study graph theory on my own using Diestel's <em>Graph Theory</em> book (with Algorithmic graph theory in mind). I don't understand what <em>local property</em>, <em>global property</em>, <em>locality</em> mean given a graph $G$. </p> <p>For example, on the page 5 it says </p> <blockquote> <p>The ave...
https://cs.stackexchange.com/questions/86260/what-does-local-mean
Question: <p>I am really confused with this <a href="https://community.topcoder.com/stat?c=problem_statement&amp;pm=13707" rel="nofollow">problem</a>.</p> <p><strong>Here's the problem:</strong> <br></p> <p>You have $N$ points numbered $1$ through $N$,inclusive, and $N$ arrows again numbered $1$ through $N$,inclusive...
https://cs.stackexchange.com/questions/59995/understanding-the-mapping-of-edges-to-nodes-in-a-graph-theory-problem
Question: <p>Sorry for the vagueness, but I'm trying to study the latest progress on the exact cover problem and using graphs for NP-complete problems. Googling around has not been very helpful. I understand the basics but I can't find a key journal in this area or where to look online. Any references would be greatly ...
https://cs.stackexchange.com/questions/142318/research-on-exact-cover-problem-and-graph-theory-for-np-complete-problems
Question: <p>If I am not mistaken, a tree is any graph that does not contain cycles.</p> <p>However, I am currently taking a bioinformatics course where we deal a lot with algorithms on phylogenetic trees. Usually you are given a phylogenetic tree with <span class="math-container">$n$</span> leafs, and then you run som...
https://cs.stackexchange.com/questions/49355/what-is-the-difference-between-regular-trees-and-phylogenetic-trees-in-terms-of
Question: <p>I am interested to learn more about <a href="https://math.stackexchange.com/questions/520768/whats-the-relation-between-topology-and-graph-theory">topological graph theory</a> and <a href="https://en.wikipedia.org/wiki/Graph_embedding" rel="nofollow noreferrer">Graph Embedding</a>.</p> <p>Assume I have a ...
https://cs.stackexchange.com/questions/90473/how-to-find-a-graph-embedding-given-a-metric-space
Question: <p>Lately graph theory has come into everyday practice with graph databases. So I wonder if any object can be written as a graph? I don't have the formal definition of an object, but say it is a C <code>struct</code> or a Java <code>Object</code>, isn't it so that we can express objects as graphs and that it ...
https://cs.stackexchange.com/questions/48888/can-any-object-be-written-as-a-graph
Question: <p>Hey I am new to graph theory and this question has me stuck for hours.</p> <p>What is an example of undirected graph with n nodes where the number of simple cycles is exponential in n.</p> <p>I was looking at complete graphs, but here's the catch: the total number of edges should be in theta of n.</p> <...
https://cs.stackexchange.com/questions/101241/undirected-graph-with-exponential-number-of-simple-cycles
Question: <p>I saw <a href="https://stackoverflow.com/questions/6284469/how-to-remove-cycles-in-an-unweighted-directed-graph-such-that-the-number-of-ed">this</a> from SO which led to <a href="https://en.wikipedia.org/wiki/Feedback_arc_set" rel="noreferrer">Feedback Arc Set</a>, which describes the problem nicely:</p> ...
https://cs.stackexchange.com/questions/90481/how-to-remove-cycles-from-a-directed-graph
Question: <p>This is my first question here!</p> <p>If I have a non-planar graph where every vertex connects to 3 other vertices, and where the edges are allowed to intersect, how do I find the boundary of the graph?</p> <p>For example in the below graph, the pink line shows the boundary of the graph which needs to be ...
https://cs.stackexchange.com/questions/124367/is-there-an-algorithm-for-getting-the-boundary-of-a-non-planar-graph
Question: <p>I got a problem related to graph theory - </p> <p>Consider an undirected graph ܩ where self-loops are not allowed. The vertex set of G is {(i,j):1&lt;=i,j &lt;=12}. There is an edge between (a, b) and (c, d) if |a-c|&lt;=1 and |b-d|&lt;=1 The number of edges in this graph is </p> <p>Answer is given as 50...
https://cs.stackexchange.com/questions/23532/number-of-edges-in-a-graph
Question: <p>Suppose we have a set of equations like this</p> <pre><code>p7=f(p1+p6); p6=f(p2+p5); p5=f(p3+p4); p4=f(p3); p3=f(p2); p2=f(p1); p1=f() </code></pre> <p>It can be represented by computational graph below</p> <p><img src="https://i.sstatic.net/LKTOM.png" width="352" height="352"> </p> <p>If each interme...
https://cs.stackexchange.com/questions/67711/memory-needed-for-computational-graph
Question: <p>Good evening! I'm actually doing an internship at the Archives Nationales of France and I encountered a situation I wanted to solve using graphs...</p> <h1>I. The dusty situation</h1> <p>We want to optimize the arrangement of books of my library according to their height in order to minimize their archive ...
https://cs.stackexchange.com/questions/48511/how-to-solve-an-arrangement-problem-at-the-archive-nationale-of-france-using-gra
Question: <p>I am an electrical engineer without experience in graph theory. However, I have a problem which I believe can be solved by graph theory. We have a directed tree, such as the one below. We want to find all the vertices and edges starting from a vertex in a given direction. For instance, in the figure below,...
https://cs.stackexchange.com/questions/112388/directed-trees-finding-all-the-edges-and-vertices-in-a-specific-direction
Question: <p>My case is a <em>directed</em> graph with <span class="math-container">$n$</span> nodes with <span class="math-container">$(n-1)^2+1$</span> edges. I have done the following till now.</p> <p>We know that the maximum number of edges for a directed graph <span class="math-container">$K_n$</span> on <span cla...
https://cs.stackexchange.com/questions/141068/is-this-graph-hamiltonian
Question: <p>I'm planning on making a fiber art $K_{37}$ (like the one I laser etched with help: <a href="http://www.thingiverse.com/thing:88130" rel="nofollow">K37: The complete graph on 37 nodes, svg</a>). To accomplish this, the plan is to construct 37 pegs equally spaced in a annulus made from wood and then to stri...
https://cs.stackexchange.com/questions/39833/finding-a-hamiltonian-path-through-the-complete-graph-on-37-vertices-k-37
Question: <p>From CLRS (3rd edition), I came have this question on page 626:</p> <p>Given these definitions from the text,</p> <p>DEFINITIONS: Given an undirected graph G = (V,E), <p>1. A CUT (S ,V-S) of G is a partition of V, <p>2. A LIGHT EDGE over a cut is any edge crossing the cut with a weight smaller than or e...
https://cs.stackexchange.com/questions/14607/clarification-sought-for-definition-of-a-cut-that-respects-a-set-a-of-edges-in-g
Question: <p>As I understand it in dataflow programming, programs are structured as directed graphs, an example of which is below <a href="https://i.sstatic.net/qII4K.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qII4K.png" alt="enter image description here" /></a></p> <p>Is it true to say that the arr...
https://cs.stackexchange.com/questions/128583/in-the-dataflow-programming-paradigm-programs-are-modeled-as-directed-graphs-ar
Question: <p>I have a coding problem I'm running into that feels like it's solved:</p> <p>Given a (directed) graph, and an equivalence relation on nodes, merge the equivalent nodes in a way that preserves the graph structure to create a &quot;factor&quot; graph, in the sense that every edge connected to one of the equi...
https://cs.stackexchange.com/questions/152000/is-there-a-term-for-factoring-a-graph-by-an-equivalence-relation-on-nodes
Question: <p>I am trying to find all the cycles in an undirected graph given the adjacency list of the vertices, with the an output of all the cycles in form of the vertices they are made up of.</p> <p>For example -<a href="https://i.sstatic.net/Ku4fd.jpg" rel="nofollow noreferrer">https://i.sstatic.net/Ku4fd.jpg</a><...
https://cs.stackexchange.com/questions/56076/find-closed-loops-in-an-undirected-graph-given-an-adjacency-list
Question: <p>I am new to this independent set problem in graph theory. As per my understanding so far an independent set is a set of vertices in which no two vertices are adjacent. And the maximal independent set is a set of vertices in which if some vertex is added it will construct an edge. </p> <p>I understand this...
https://cs.stackexchange.com/questions/93405/given-all-maximal-independent-sets-of-a-graph-find-the-maximum-indepdent-set
Question: <p>I'm taking a class on graph theory that uses "Graph Theory (Graduate Texts in Mathematics)" by Bondy and Murty. One of the questions is about Cayley graphs and the n-cube, and I don't understand how to interpret it. It runs as follows:</p> <blockquote> <p>Let $\Gamma$ be a group and $S$ be a subset of $...
https://cs.stackexchange.com/questions/23724/n-cube-as-a-cayley-graph
Question: <p>I read about correctness of iterative and recursive algorithms.I need a sequence of book recommendations for learning mathematical aspects of computer networks and data communtions such as applications of graph theory and number theory in routing and security and error control respectively.Please provide l...
https://cs.stackexchange.com/questions/142304/reference-request-on-computer-networks
Question: <p>While reading graph theory, I came across different definitions where they use partitions and divisions, I was wondering, are these terms same or different?</p> <p>Can anyone explain me their difference in Set Theory?</p> <p>I know this is a simple question but anyone hardly talk about it but they always m...
https://cs.stackexchange.com/questions/139384/what-is-the-difference-between-partition-and-division
Question: <p>I have started reading graph theory from <a href="https://mitpress.mit.edu/books/introduction-algorithms" rel="nofollow">Introduction to Algorithm</a>. The author starts by saying that if the graph is dense then:</p> <p>$$|E|\text{ close to }|V|^2$$ else if the graph is sparse then:</p> <p>$$|E|\text{ is...
https://cs.stackexchange.com/questions/49062/space-complexity-of-directed-and-undirected-graph
Question: <p>I developed an algorithm that transforms any simple connected graph, cyclic or not, into a tree. The resulting tree is syntax-preserving, in a sense that it allows to reconstruct the original input graph and only the original input graph. In other words, the constructed tree preserves adjacency information...
https://cs.stackexchange.com/questions/126500/does-an-algorithm-exist-that-transforms-any-connected-graph-cyclic-or-not-into
Question: <p>Sir i recently started graph theory. I understood the reason why edge connectivity is less than min degree(remove all vertices incident to min degree vertex). I have doubt in 2nd part of proof when given graph is not complete graph. how to prove here vertex connectivity less than edge connectivity? confuse...
https://cs.stackexchange.com/questions/109400/doubt-in-vertex-connectivity-less-than-edge-connectivity
Question: <p>I am currently working to understand the use of the <a href="https://en.wikipedia.org/wiki/Cheeger_bound" rel="noreferrer">Cheeger bound</a> and of Cheeger's inequality, and their use for spectral partitioning, conductance, expansion, etc, but I still struggle to have a start of an intuition regarding the ...
https://cs.stackexchange.com/questions/109963/intuition-behind-eigenvalues-of-an-adjacency-matrix
Question: <p><a href="https://i.sstatic.net/20JSo.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/20JSo.jpg" alt="enter image description here"></a></p> <p>I have this problem, not sure there is a name for it, wherein a Directed Acyclic Graph has different colored nodes. The idea is to partition it into...
https://cs.stackexchange.com/questions/112221/directed-acyclic-graph-partition-into-minimum-subgraphs-with-a-constraint
Question: <p>What are some applications that require computing the <a href="http://en.wikipedia.org/wiki/Permanent" rel="nofollow">permanent of a matrix?</a></p> <p>One application I know of is related to graph theory and matchings. Apparently, the number of perfect matchings of a bipartite graph is the permanent of i...
https://cs.stackexchange.com/questions/14438/what-are-some-applications-of-computing-the-permanent-of-a-matrix
Question: <p>I'm basically looking for an example (in maybe graph theory) of a constraint satisfaction problem which has a 3-element set as a domain and the problem is known to be polynomial-time solvable.</p> Answer: <p>If you want a graph, it needs to be bipartite. Hence the path of two edges or any subgraph thereof...
https://cs.stackexchange.com/questions/98307/is-there-a-well-known-example-of-a-constraint-satisfaction-problem-on-a-3-elem
Question: <p>The Queen of England wants to organize a set of tables for n guests talking different languages. The tables have to be set in a way that every guest can speak to his neighbor on the right and his neighbor on the left.</p> <p>Four possibilities come up : 1- One table for all guests. 2- One table for all gu...
https://cs.stackexchange.com/questions/77178/n-guest-table-graph-problem
Question: <p>I'm a little unfamiliar with graph theory, and I found an interesting problem in my work that I do not know if its already well-known or can be easily mapped to another one. If I were to express the problem more formally:</p> <p>Given a directed unweighted graph $\langle V,E \rangle$, find a total order b...
https://cs.stackexchange.com/questions/68894/is-the-optimal-order-of-graph-vertices-s-t-minimizes-edges-to-later-vertices-a
Question: <p>I am very new to Graph Theory and I am trying to prove the following statement from a problem set for my class: </p> <p>Prove that if G is a regular graph on n vertices $(n \ge 2)$, then $\omega(G) \in \{1, 2, 3,... \lfloor n / 2 \rfloor, n\}$</p> <p>I am confused by the part where it places the clique...
https://cs.stackexchange.com/questions/90799/proving-clique-number-of-a-regular-graph
Question: <p><a href="https://i.sstatic.net/tzRlh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tzRlh.png" alt="enter image description here" /></a></p> <p>I am a beginner in graph theory and just found this question in a book after completing few topics and I was wondering how you approach this questi...
https://cs.stackexchange.com/questions/140167/determine-eulerian-or-hamiltonian
Question: <p>I have a graph theory or combinatorics problem that probably has a solution, but I haven't been able to find it. The problem can be simple: in the second figure below, choose one yellow block from each oval such that the blue edges between the blocks look like the edges in the first figure below. Find all ...
https://cs.stackexchange.com/questions/145901/find-all-combinations-of-adjacent-records-matching-a-graph-template
Question: <p>I am reading up on graph theory from the book <em>Algorithm Design Manual - Skiena</em>. And he shows a structure of a graph as follows : </p> <pre><code>#define MAXV 100 /* maximum number of vertices */ #define MAXDEGREE 50 /* maximum outdegree of a vertex */ typedef struct { in...
https://cs.stackexchange.com/questions/57722/why-does-skiena-reserve-space-for-n1-adjacency-lists
Question: <p>I have been trying to understand, what is the actual meaning of 2 graphs being:</p> <pre><code>Symmetric Transitive Reflexive A graph being a subgraph of another graph </code></pre> <p>And other similar relations if let's say I have two graphs containing 1000's of nodes and edges. Then, what do these ter...
https://cs.stackexchange.com/questions/28135/what-is-theory-behind-graphs-relations
Question: <p>I am supposed to calculate all-pair shortest path lengths of a graph. However, I first need the graph to be decomposed/expanded to a <strong>simple</strong> one based on the presence of parallel edges. </p> <p>If N parallel edges exist between any two vertices <strong>A</strong> and <strong>B</strong>, I ...
https://cs.stackexchange.com/questions/117696/decomposition-of-graph-to-subgraphs-according-to-parallel-edges
Question: <p>I recently learned some graph theory in Discrete Structures for Computer Science, we learned about the Four Color theorem, I realize there is a mathematical proof for this topic, but how was it initially proved using computation 50 years ago?</p> Answer:
https://cs.stackexchange.com/questions/118873/how-was-the-four-color-theorem-proved-using-brute-force-search
Question: <p>I am EXTREMELY confused on where to start with this problem. We recently just started learning about graph theory and I don't know where to begin.</p> <blockquote> <p>Prove that in a connected graph G with $p$ vertices, $q$ edges, and at least one cycle, $q \ge p$</p> </blockquote> <p>How do I begin wi...
https://cs.stackexchange.com/questions/66391/prove-that-at-least-as-many-edges-as-vertices-implies-a-cycle
Question: <p>I have found this interesting problem in graph theory and geometry which is allegedly an open problem but latest status seems to be from 01/25/02. I can't seem to find any more information about it, not even other papers describing it.</p> <p><a href="https://i.sstatic.net/jT7Ub.png" rel="nofollow norefer...
https://cs.stackexchange.com/questions/119665/status-on-naoki-katohs-rectangle-wiring-problem-minimum-length-tree-to-cover
Question: <p>I was going through graph theory and came across the term Euler path or some people prefer Euler trail as vertices can repeat.</p> <p>According to the definition from wiki (<a href="https://en.wikipedia.org/wiki/Eulerian_path" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Eulerian_path</a>), Eul...
https://cs.stackexchange.com/questions/92930/is-it-necessary-to-cover-all-the-verticies-in-eular-path
Question: <p>I was playing around with graph theory and I noticed that a directed integer graph with unique vertices <span class="math-container">$V$</span> and edges <span class="math-container">$E$</span> such that each vertex only points to vertices with a higher value can be used to enumerate all <span class="math-...
https://cs.stackexchange.com/questions/138207/find-all-the-ways-to-choose-k-objects-from-a-list-of-n-objects-using-a-grap
Question: <p>I read that Category Theory has alot to do with how programs and information can be organised.Can Category theory simplify various programming strategies? If a specific Category is represented as a directed graph is this similar to flow charts used in programming?</p> Answer:
https://cs.stackexchange.com/questions/23872/about-computer-science-and-category-theory
Question: <p>According to the theorem(see reference) on the rigidity of frameworks:</p> <blockquote> <p>A rectangular framework is rigid if and only if its associated bipartite graph is connected.</p> </blockquote> <p>Now consider the case for a 2-by-2 rectangular framework.</p> <p><a href="https://i.sstatic.net/XPgX3s...
https://cs.stackexchange.com/questions/159737/is-it-possible-to-have-a-2-by-2-rigid-framework-without-having-a-corresponding-c
Question: <p>Basically, it's this <a href="http://rosalind.info/problems/tree/" rel="nofollow noreferrer">rosalind</a> problem.</p> <p>You're given a number of nodes and an adjacency list. My initial guess was that the answer was the number of connected components minus 1, since by joining every connected component you...
https://cs.stackexchange.com/questions/134364/minimum-number-of-edges-that-should-be-added-to-an-undirected-graph-to-make-it-a
Question: <p>Hello computer scientists,</p> <p>I am a mathematician. I have taken some undergraduate courses in C++, Python, assembly language, boolean algebra, logic, graph theory, etc. I would like to learn more about computer science because I think it's cool. Could you give me some advice as to where to start? Tha...
https://cs.stackexchange.com/questions/131528/i-want-to-learn-more-about-computer-science-where-should-i-start
Question: <blockquote> <p>In graph theory, the crossing number cr(G) of a graph G is the lowest number of edge crossings of a plane drawing of the graph G. (from wikipedia)</p> </blockquote> <p>I know that the problem of counting the <a href="https://en.wikipedia.org/wiki/Crossing_number_(graph_theory)" rel="nof...
https://cs.stackexchange.com/questions/44296/how-to-prove-np-completeness-of-minimum-crossing-problem
Question: <p>I get stuck with the following two criteria both about the uniqueness of plane embeddings of a given planar graph. The first one says that a planar graph admits unique plane embedding iff it is a subdivision of 3-connected planar graph (e.g. from the book "Planar Graphs: Theory and Algorithms"). The second...
https://cs.stackexchange.com/questions/54540/a-criterion-for-the-planar-graph-to-have-unique-dual
Question: <p>Suppose given an un-directed graph <span class="math-container">$G$</span>, such that bridge edge of <span class="math-container">$G$</span> has negative weight.</p> <p><a href="https://en.wikipedia.org/wiki/Bridge_(graph_theory)#:%7E:text=In%20graph%20theory%2C%20a%20bridge,can%20uniquely%20determine%20a...
https://cs.stackexchange.com/questions/142844/negative-edge-weight-in-dijkstra
Question: <p>Are there specific terms or adjectives in graph theory to name these two situations?</p> <ul> <li>Two vertices are non-adjacent (disjoint? I have seen that the term &quot;disjoint&quot; is rather used for paths with non-common vertices or edges).</li> <li>Two connected non-adjacent vertices (the shortest p...
https://cs.stackexchange.com/questions/112660/connected-but-not-adjacent-vertex
Question: <p><em>(Diestel, Graph Theory)</em> <strong>Corollary 1.5.2:</strong> Every tree has an enumeration of the vertices <span class="math-container">$\{v_1, v_2\ldots v_n\}$</span> such that each vertex <span class="math-container">$v_i$</span>, with <span class="math-container">$i\geq 2$</span>, has a unique ne...
https://cs.stackexchange.com/questions/156294/enumeration-of-tree-vertices-such-that-each-vertex-has-unique-neighbor-appearing
Question: <p>In graph theory, a source of a directed graph <span class="math-container">$D = (V(D), E(D))$</span> is a vertex of it whose in-degree is zero.</p> <p>The book CLRS makes these statements:</p> <p>Given a graph <span class="math-container">$G = (V, E)$</span> and a distinguished source vertex <span class="m...
https://cs.stackexchange.com/questions/144139/meaning-of-source-here
Question: <p>This is a distributed systems problem, but perhaps the graph theory gurus can help me.</p> <p>I need an algorithm that that tells me which nodes to remove from the graph to completely remove connectivity. </p> <p>See example:</p> <p><a href="https://i.sstatic.net/eoLoF.png" rel="nofollow noreferrer"><im...
https://cs.stackexchange.com/questions/70380/algorithm-to-delete-nodes-that-completely-removes-connectivity
Question: <p>Having extracted the data-flow in some rather large programs as directed, acyclic graphs, I'd now like to optimize the order of evaluation to minimze the maximum amount of memory used.</p> <p>That is, given a graph {1 -> 3, 2 -> 3, 4 -> 5, 3 -> 5}, I'm looking for an algorithm that will decide the order o...
https://cs.stackexchange.com/questions/1752/optimizing-order-of-graph-reduction-to-minimize-memory-usage
Question: <p>I've read about basic planar-graph embedding and about embedding a planar graph onto a set of fixed points, but I was wondering how one might constrain the locations of some nodes—perhaps to a set of points—while allowing others complete freedom.</p> <p>Is this achievable with a current popular algorithm,...
https://cs.stackexchange.com/questions/79662/planar-embedding-with-some-nodes-constrained
Question: <p>Can a single node be considered a subgraph?</p> <p>For example, if I had this graph, G:</p> <p><code>X</code>-----<code>Y</code> </p> <p>and I deleted Y, leaving me with the graph</p> <p><code>X</code></p> <p>is this a subgraph (induced) of G? <br><br><br><br> What about the following argument? </p> ...
https://cs.stackexchange.com/questions/41856/computing-theory-can-a-single-node-be-a-subgraph
Question: <p>I am a final semester pure math undergrad, and I became interested in Linear Cellular Automatas.I became interested after reading Klaus Sutner's <a href="https://www.link.cs.cmu.edu/15859-s11/notes/sutner.pdf" rel="nofollow noreferrer">article</a>. In the article, a little abstract algebra is used, linear ...
https://cs.stackexchange.com/questions/148713/textbook-request-for-linear-cellular-automata-if-possible-with-an-abstract-alge
Question: <p>Algorithm complexity is designed to be independent of lower level details but it is based on an imperative model, e.g. array access and modifying a node in a tree take O(1) time. This is not the case in pure functional languages. The Haskell list takes linear time for access. Modifying a node in a tree inv...
https://cs.stackexchange.com/questions/74494/how-is-algorithm-complexity-modeled-for-functional-languages
Question: <p>Where should I look for a good introductory text in algorithm complexity? So far, I have had an Algorithms class, and several language classes, but nothing with a theoretical backbone. I get the whole complexity, but sometimes it's hard for me to differentiate between O(1) and O(n) plus there's the whole t...
https://cs.stackexchange.com/questions/3201/good-text-on-algorithm-complexity
Question: <p>I need your help with time complexity.</p> <p>I have this recursive function: $$ F(n) = \left\{ \begin{array}{l l} F(n-2) + 10 F\big(\frac{n}{6}\big)^2 + 6 F\big(\frac{n}{7}\big) + \frac{n^4}{5} &amp; \text{if } n &gt; 1\\ 2 &amp; \text{otherwise}\\ \end{array} \right. $$</p> <p>and I had to do the sam...
https://cs.stackexchange.com/questions/73690/recursive-algorithm-complexity
Question: <p>This might be very basic but I am interested in evaluating the algorithmic complexity of an estimator of the form:</p> <p>$$\hat{\theta} = \text{argmin}_{\theta} \;\; Q_n (\theta)$$</p> <p>where $Q_n(\theta)$ denotes some objective function of interest (e.g. - log likelihood) computed on a sample of leng...
https://cs.stackexchange.com/questions/65987/algorithmic-complexity-of-statistical-estimators
Question: <p>I'm working on an algorithm that takes an array of <span class="math-container">$N$</span> values and it will iterate through each of the values and in each of them iterate through the rest of the array to the right. So the first value will check <span class="math-container">$N-1$</span> positions, the nex...
https://cs.stackexchange.com/questions/98523/algorithm-complexity-similar-to-selection-sort
Question: <p>I'm practicing leet code questions and want to understand more fully how to determine Big O notation. What is the algorithmic complexity of my solution to the following problem? </p> <p><strong>O(n^2) ?</strong> For every item in n I could loop an additional n[i] times. Or is it <strong>O(n)</strong> ?</p...
https://cs.stackexchange.com/questions/121269/what-is-the-algorithmic-complexity-of-this
Question: <p>Are all algorithms which have polynomial time complexity belong to P class ? And P class do not have any algorithm which does have not polynomial complexity ? </p> <p>Are all algorithms which have non polynomial complexity belong to NP or NP-Hard or both ?</p> <p>I am just trying to understand the basic ...
https://cs.stackexchange.com/questions/9909/the-exact-relation-between-complexity-classes-and-algorithm-complexities
Question: <p>We say that if an algorithm takes p time for an input size of n (here, p is a polynomial in n, and the degree of p is y), then the algorithm's complexity is O(n^y).</p> <p>In the image, when n is very large it does not seem to matter much if it's x^2 or 2x^2. but, it clearly seems to matter if it's x or 2x...
https://cs.stackexchange.com/questions/152316/algorithm-with-linear-time-complexity
Question: <p>I have been unable to find a graph depicting or text answering the following question: Is there a direct relationship between the complexity of an algorithm (such as best / worst case of quick sort), and class of automata that can implement the algorithm. For example is there a range of complexity push dow...
https://cs.stackexchange.com/questions/52748/relationship-of-algorithm-complexity-and-automata-class
Question: <p>For example, we have $T(N) = T(N/2) + T(N/5) + O(N)$. So:</p> <p>$2T(N/2) + O(N) \leq T(N) \leq 2T(N/5) + O(N)$</p> <p>$O(N) \leq T(N) \leq O(N)$. Thus, $T(N) = O(N)$. Is it correct?</p> Answer:
https://cs.stackexchange.com/questions/70976/algorithm-complexity
Question: <p>this is my first question on this site and I would like to preface this by saying I am not very savvy when it comes to Computer Science. So, I will try to ask this the best I can.</p> <p>I was doing some research on Polynomial time because that is what I was told hashing algorithms run on, correct me if I ...
https://cs.stackexchange.com/questions/150440/algorithm-complexity-question
Question: <p>Let <span class="math-container">$H=\left(V_H, E_H\right)$</span> and <span class="math-container">$G=(V, E)$</span> be graphs. A <em>subgraph isomorphism</em> from <span class="math-container">$H$</span> to <span class="math-container">$G$</span> is a function <span class="math-container">$f: V_H \rightar...
https://cs.stackexchange.com/questions/162703/algorithmic-complexity-of-recognizing-claw-free-graphs
Question: <p>I have been trying to find the algorithmic complexity of a problem that I have. I am almost sure it is either NP-hard or NP-complete but I cannot find any proof. Recently, I found that my problem can be something similar to a special instance of the Maximum Capacity Representatives problem, which is NP-com...
https://cs.stackexchange.com/questions/77192/algorithmic-complexity-of-a-maximum-capacity-representatives-variant
Question: <p>We have an array of N size. We have to perform Q queries on it, in which each Query contains and Index I for which we do:</p> <pre><code>for j=I+1 to N: if A[j]&lt;A[I]: A[j]=0 </code></pre> <p>The Queries are not independent of each other so we need to use the changed Array everytime.</p> <p>I ha...
https://cs.stackexchange.com/questions/116916/improve-algorithmic-complexity
Question: <pre><code>"The designer of an algorithm needs to balance between space complexity and time complexity." - Comment on the validity of the statement in the context of recursive algorithms. </code></pre> <p>This is a question from my university's previous paper. But i couldn't find a decent answer. Actually i ...
https://cs.stackexchange.com/questions/13055/time-complexity-and-space-complexity-in-recursive-algorithm
Question: <p>From what I've read, Big O is the absolute worst ever amount of complexity an algorithm will be given an input. On the side, Big Omega is the best possible efficiency, i.e. lowest complexity.</p> <p>Can it be said then that every algorithm has a complexity of $O(\infty)$ since infinite complexity is the ...
https://cs.stackexchange.com/questions/8998/is-every-algorithms-complexity-omega1-and-o-infty
Question: <p>I really get confused by all the different complexities you find around. One is $O(n \log n)$, the next $O(n \cdot |\Sigma|)$. Personally I think it's the last one, but I'm really not that confident with it to say so. Well on average we go $\log n$ deep and need at max $|\Sigma|$ steps to find a correspond...
https://cs.stackexchange.com/questions/41199/suffix-tree-algorithm-complexity
Question: <p>I've learned <a href="https://cs.stackexchange.com/questions/63889/is-there-a-decision-algorithm-with-time-complexity-of-%d3%a8n%c2%b2?noredirect=1#comment135296_63889">today</a> that algorithm analysis differs based on computational model. It is something I've never thought about or heard of. </p> <p>An ...
https://cs.stackexchange.com/questions/63900/algorithm-complexity-analysis-on-functional-programming-language-implementations
Question: <p>In the book <a href="http://www.cs.uu.nl/geobook/" rel="noreferrer">&quot;Computational Geometry: Algorithms and Applications&quot;</a> by Mark de Berg et al., there is a very simple brute force algorithm for computing Delaunay triangulations. The algorithm uses the notion of <em>illegal edges</em> -- edge...
https://cs.stackexchange.com/questions/2400/brute-force-delaunay-triangulation-algorithm-complexity
Question: <p>When in a Parallel algorithm we say:</p> <blockquote> <p>"This algorithm is done in $O(1)$ time using $O(n\log n)$ work, with $n$-exponential probability, or alternatively, in $O(\log n)$ time using $O(n)$ work, with $n$-exponential probability."</p> </blockquote> <p>Then Can we Implement this algorith...
https://cs.stackexchange.com/questions/7371/a-question-about-parallel-algorithm-complexity
Question: <p>Student asked me this question. During lectures on algorithm complexity I've shown similar picture (<a href="https://towardsdatascience.com/linear-time-vs-logarithmic-time-big-o-notation-6ef4227051fb" rel="nofollow noreferrer">source</a>):</p> <p><a href="https://i.sstatic.net/y4RLi.png" rel="nofollow nor...
https://cs.stackexchange.com/questions/95987/which-complexity-represents-a-majority-of-algorithms
Question: <p>I have an algorithm which searches a sorted int array for two elements which sum up to a searched value. First I thought that the complexity is $\mathcal{O}(n)$, but the interpolation search algorithm has a similar approach and has a $\mathcal{O}(\log(log(n)))$ complexity with uniform distributed elements....
https://cs.stackexchange.com/questions/82340/complexity-of-search-algorithm
Question: <p>It might be a silly question, I do take a carefully read about approximation algorithm through coursenotes, but when I saw the words "approximation algorithm with polynomial complexity", I can't understand what it means, I searched a lot and here is my assumption.</p> <p>First, for some NPc or NP hard pro...
https://cs.stackexchange.com/questions/75286/approximation-algorithm-with-polynomial-complexity
Question: <p>In theory of distributed systems, I understand message complexity and time complexity are common performance measures, with the first being the number of messages sent in the overall execution of the algorithm, and the time being the number of "steps" it takes to complete the algorithm. </p> <p>My questio...
https://cs.stackexchange.com/questions/90946/async-distributed-algorithm-time-complexity
Question: <p>I cannot seem to find a precise definition of what "super-exponential" is supposed to refer to when one's talking about an algorithm's time complexity.</p> <p>For instance, if an algorithm runs for <span class="math-container">$nC(n-1)$</span> steps, where <span class="math-container">$C(\cdot)$</span> is...
https://cs.stackexchange.com/questions/99605/is-super-exponential-a-precise-definition-of-algorithmic-complexity
Question: <p>Considering $n$ number of pieces of data, what would Dijkstra's shortest path algorithm time complexity be if it was stored using a data structure with following properties? </p> <p>• delete the record with the minimum value of the key (complexity $O(log n)$);</p> <p>• decrease the key of some record (c...
https://cs.stackexchange.com/questions/85311/what-would-dijkstras-shortest-path-algorithm-complexity-be-with-the-following-d
Question: <p>In my automata theory class, for our term project we are required to present a complexity analysis for our algorithmic problem. I have chosen an unsolvable problem, and he has off-the-cuff mentioned that any unsolvable problem would have a complexity of infinite.</p> <p>However, this strikes me as strange...
https://cs.stackexchange.com/questions/56556/complexity-analysis-of-an-unsolvable-algorithmic-problem
Question: <p>I am trying to find complexity for following algorithm. It is from &quot;The Algorithm Design Manual&quot; book.</p> <pre><code>for k = 1 to n: x = k while (x &lt; n): print ’*’ x = 2x </code></pre> <p>I simulated algorithm for some values. Each time inner loop operates on <code>n-k</code...
https://cs.stackexchange.com/questions/165211/time-complexity-for-logarithmic-algorithm
Question: <p>What is the complexity class of an algorithm that runs in <span class="math-container">$n^{\mathcal{O}(\sqrt{n}log(n))}$</span> time? </p> <p>As <span class="math-container">$n$</span> gets large <span class="math-container">$\sqrt{n}log(n)$</span> increases at a very slow rate. Does this mean that the al...
https://cs.stackexchange.com/questions/122216/complexity-class-of-an-algorithm
Question: <p>Question: Given an array of positive integers and a target total of X, find if there exists a contiguous subarray with sum = X </p> <p>E.g: If array is [1, 3, 5, 18] and X = 8 Output: True, if X = 10, output is FALSE.</p> <p>Approach I can think of is to expand sub-array window, until you hit an index ...
https://cs.stackexchange.com/questions/63837/algorithmic-complexity-of-sub-array-with-sum-target-algorithm
Question: <p>According to CLRS, the Prim's algorithms is implemented as below -- </p> <blockquote> <p>$\mathtt{\text{MST-PRIM}}(G,w,r)$ </p> <ul> <li>for each $u \in V[G]$ do<br> <ul> <li>$\mathtt{\text{key}}[u] \leftarrow \infty$ </li> <li>$\pi[u] \leftarrow \mathtt{\text{NIL}}$ </li> </ul></li> ...
https://cs.stackexchange.com/questions/13608/mst-prims-algorithm-complexity-why-not-oev-lg-v
Question: <p>I'm implementing an algorithm that analyze several properties on large set of integers, the time complexity is bound to $N$ (set length) and $M$ (bits to represent the numbers). I'm having some trouble to figure out how to express its time complexity because I don't know how to handle next situation:</p> ...
https://cs.stackexchange.com/questions/63361/algorithm-time-complexity-analysis-for-algorithm-having-two-different-time-compl