Category "graph-theory"

How to implement a "reverse" BFS algorithm?

I'm playing a game with the following rules: There is a map (with walls), some coins (randomly generated in the map) and a Minotaur. The goal is to grab as many

Mark Node as Failed under graphlib TopologicalSorter

From graphlib.TopologicalSorter, I can process nodes from a graph in parallel via: topological_sorter = TopologicalSorter() topological_sorter.prepare() while

RL + optimization: how to do it better?

I am learning about how to optimize using reinforcement learning. I have chosen the problem of maximum matching in a bipartite graph as I can easily compute the

Finding the girth of a graph with networkx

Does NetworkX have a method or function that I can use to figure the girth of a graph? For context, I'm trying to verify that a Mycielskian graph that I'm const

In SPFA Shortest Path Faster Algorithm why does it have to check if current vertex is in queue before adding it to queue?

procedure Shortest-Path-Faster-Algorithm(G, s) 1 for each vertex v ≠ s in V(G) 2 d(v) := ∞ 3 d(s) := 0 4 push s into Q 5 w

Throw an error if multiple shortest paths are found

Given an undirected weighted graph, a start, and an end point. You need to find the shortest path to that end point, but throw an error if multiple shortest pat

Color a subset of vertices but not their edges with visIgraph

How can I set the color of a subset of the graph nodes without also coloring their edges using visNetwork::visIgraph? Currently, my function vis_graph_prototypi

When can we have duplicate nodes in the heap in dijikstras algorithm?

So this question came to my mind when solving some dijikstra's based leetcode problems. We have node, distance pairs in priority queue at each step. Having dupl

Find paths between nodes in JS object graph

How can I get this result: [ {Paris,Amsterdam,Berlin}, {Paris,Bruxelles,Amsterdam,Berlin}, {Paris,Bruxelles,Berlin} ] from this array: [ { HD: '9:2

Graph learning in R, igraph, tidygraph

I have a graph with each node having a value (value in red). I would like to do the following two things (I guess 1 is a special case of 2): Each node should b

assignment prob flow network solution

I have an assignment problem with cost matrix C, eg: 21 30 26 16 20 27 29 28 20 38 39 25 21 19 23 28 24 30 29 16 30 33 32 17 31 where C[i][j] means cost for wor