## Independent sets into which all the vertices of the graph can be split

How to prove that if $$G$$ is an acyclic transitive digraph, then the least independent sets into which all vertices of G can be divided is equal to the size of the longest paths to $$G$$?

Posted on Categories proxies

## Semi streaming algorithm for 2 vertices connectivity

Let $$G=(V,E)$$ be an undirected graph. given a pair of vertices $$s,t \in V$$, how can we construct a semi-streaming algorithm which determines is $$s$$ and $$v$$ are connected? Is there any way to construct such an algorithm which scans the input stream only once?

Note that a semi-streaming algorithm is presented an arbitrary order of the edges of $$G$$ as a stream, and the algorithm can only access this input sequentially in the order it is given; it might process the input stream several times. The algorithm has a working memory consisting of $$O(n⋅polylogn)$$.

Posted on Categories proxies

## Remove vertices

Given an undirected graph G(V,E), find the minimum number of vertices to remove so that the Edge Set of the graph becomes $$\phi$$.

In other words: If we remove one vertex we remove that vertex along with all edges connected to that vertex. Find the minimum number of vertices to remove so that there are no edges left in G after their removal.

## Finding maximum subgraph with vertices of degree at most k

Let $$G = (V, E)$$ be an undirected graph and $$U \subseteq V$$ some subset of its vertices. An induced graph $$G[U]$$ is graph created from $$G$$ by removing all vertices that are not part of the set $$U$$.

I want to find a polynomial time algorithm that has graph $$G = (V, E)$$ and integer $$k$$ as input and returns a maximum set $$U \subseteq V$$ with largest size such that all vertices of $$G[U]$$ have degree at most $$k$$.

My idea with greedy algorithm that removes vertices with largest degree or vertices connected with most vertices with degree greater than $$k$$ doesn’t work.

Does anyone know how to solve this problem in polynomial time?

Posted on Categories proxies

## Paint graph ordered vertices

I have the following question: Given graph $$G=(V,E)$$ with given order on its vertices, I mean $$v_1 I need to find minimal colors ordered paining of the graph vertices s.t neighbor vertices don’t have the same color, I mean: $$(v_1,v_2,…,v_j)$$ – painted in fist color and non of them are neighbors. $$(v_{j+1},…,v_l)$$ – painted in second color and non of them are neighbors. and so on.

The complexity needs to be $$O(V+E)$$. Anyone have an idea?

## Navmesh awkward path generation with string pulling due to “inner” vertices

I’ve identified a problem and a possible solution related to navmesh-based pathfinding. Before diving in, I’ll preface my post with some questions to keep in mind as you read:

• Is this a known problem that people have solved before?
• Is there a term for the problem that could help me search for information related to it?
• Is the solution I came up with an existing idea? If so is there a name for the algorithm or some other search term I could use to find more information?
• Is there a better solution? If so, please point me to it.

For reference, I’m using images from http://jceipek.com/Olin-Coding-Tutorials/pathing.html#navigation-meshes and generally following the advice laid out there.

tl;dr of that blog post is

Decompose your walkable area into a navmesh, treating convex polygons as nodes and their borders as edges so that you can perform an A* search to get from point A to point B. To translate from “node ids” back to real points, use string-pulling.

Here’s a copy of the example space: And an example generated path after performing string pulling: So far so good.

But I realized this approach generates an awkward path in a situation like this: In this situation, a trio of nodes are all adjacent to each other, and so the A* will generally choose a path directly from the starting node to the ending node, despite an intuitive understanding that the agent can move in a straight line from A to B which travels through a different polygon.

I’ve been working on a solution to this problem and so far my best idea is to apply a transformation to the nav mesh. My description of this will be a little hazy as I’m making up terminology to describe the approach…

• Define a shared edge as a line segment that is shared by two convex polygons in the navmesh. Maybe a.k.a. a “portal” for string-pulling purposes.
• Define an inner vertex as a vertex in the navmesh for which all attached line segments are “shared edges”. The vertex in the center of the three polygons in the image above is an inner vertex.
• Identify an inner vertex. Follow its attached shared edges to what I’ll call neighbor vertex. (possible improvement; If the neighbor vertex is also an inner vertex, recurse to its neighbors until all of the neighbors are non-inner.)
• Remove all shared edges from the navmesh that were traversed in the previous step, forming a new polygon whose border is defined by the neighbor vertices in the previous step. Redefine the edges accordingly (I’ll hand-wave that)
• Repeat until no inner vertices remain.

The result of this on the example above should result in this: And with the same A-B path from before, the string-pulling should now result in a straight line: I believe that as long as the navmesh has no inner vertices, all paths generated with the approach described in the linked blog post should seem “natural” and not have any surprise corners in what seems like open space.

Per my questions at the beginning of this post, I’m looking for more information, e.g. has anybody else solved this problem before, is there a better way to do it, and is there even a name/term for this problem?

Posted on Categories Free Proxy

## Given a tournament with $2^n$ vertices, show that there is a sub-tournament with at least $n + 1$ vertices that is acyclic

So a tournament is just a complete directed graph, I believe.

I’m having trouble proving this problem. I know it is induction however. I was thinking the base case is $$2^1$$ vertices, and therefore we have a sub-tournament of 1 + 1 vertices, which holds.

Then in our induction step we have to show $$2^{n + 1}$$. But I’m not sure how to approach this. Any ideas would be extremely appreciated.

Posted on Categories proxies

## find shortest paths from source to all vertices using Dijkstra’s Algorithm?

For Dijkstra’s,i can find shortest paths from source to all vertices in the given graph but how can i calling the algorithm |V| times taking each vertex as a source and store all tables ??? For example : What is the shortest path from 1 to 4? You need to print the value and the exact path vertices starting from 1 and ending at 4.

Posted on Categories proxies

## write a c++ code to solve shortest path between any two input vertices

Implement Floyd’s Algorithm and Dijkstra’s algorithm using all vertices as sources to solve All- pairs shortest path problem. For Dijkstra’s, you need to call the algorithm |V| times taking each

vertex as a source and store all tables. As a hint you may define T, presented in class, as a two- dimensional array, instead of being a one-dimensional array, of structures. You will read a graph

with random edge weights from a file and store the graph information in an adjacency matrix. Then, you need to answer any query asking for the shortest path between any two input vertices. You need to print the path from Floyd’s and Dijkstra’s algorithms. Your program should ask the user for the name of the input file.

Posted on Categories proxies

## Check if a pair of vertices belongs to the min-cut

Given a digraph $$G = (V,A)$$ with a source $$s \in V$$ and a sink $$t \in V$$, I need to adapt the graph to known if a pair of vertices $$u \in V$$ and $$v \in V$$ belongs to the min-cut $$S$$ between $$s$$ and $$t$$. That is, a new vertex $$a$$ belongs to the min-cut $$S$$ if and only if $$u \in S$$ and $$v \in S$$. This new vertex must preserve the original max-flow from $$s$$ to $$t$$. I tried creating new arcs $$(u,a)$$ and $$(a,v)$$ with infinity capacities, but while $$a$$ belongs to $$S$$ when $$u \in S$$, this immediately forces $$v$$ to belong to $$S$$ also, which is not necessarily true if the max-flow was computed in the original graph $$G$$. So, is there a way to force a new node to be in the min-cut set $$S$$ if a pair of vertices belongs to $$S$$?