python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How can I transform an adjacency matrix into an incidence matrix?
I created an adjacency matrix from an adjacency list, but I don't know how to create the incidence matrix from this data.
My code is this:
import numpy
graph = {'1': [{'2':'15'}, {'4':'7'}, {'5':'10'...
Andres Arroyave Carmona
Votes: 0
Answers: 1
Pushing to one element in a nested array is adding to all elements in javascript
I am creating a prefilled nested array and want to push elements to specific indexes, but the elements are being added to all indexes.
let arr = new Array(4).fill([])
arr => Array(4) [ [], [], [], ...
xeroshogun
Votes: 0
Answers: 2
Converting a grid into a weighted adjacency list
const grid = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8]
]
In the grid above, traversing left to right has a cost of 10 and up to down has a cost of 25. I'd like to represent this in a undirected weighted adja...
helloroos
Votes: 0
Answers: 2
delete a specific node in a grapgh adjacency list -directed graph
hi there I have this struct info
struct Node
{
int dest, weight;
struct Node *next;
};
I want to build a function that removes a specific node distance value
my main function for calling the del...
noor shein
Votes: 0
Answers: 2