13
голосов
12ответов
2589 просмотров

How can I learn higher-level programming-related math without much formal training?

I haven't taken any math classes above basic college calculus. However, in the course of my programming work, I've picked up a lot of math and comp sci from blogs and reading, and I genuinely believe I have a decent mathematical mind. I enjoy and have success doing Project Euler, for example. I ...

1
голосов
6ответов
805 просмотров

What's the name for directed trees with edges pointing towards the root?

What do you call a graph that's almost an arborescence, but where the edges go in the opposite direction? That is, a directed graph with a center node, where every node has exactly one path to the center? It might help to have a reason for naming this thing. I'm looking to describe the control s...

4
голосов
3ответов
3971 просмотров

Algorithm to Find Overlapping Line Segments

n4------------------n3--------------------n2--n1 | | | | | | | P1 | | | | | | | n6--n5 | | | | ...

1
голосов
1ответов
107 просмотров

Analyzing Path Data

I have data representing the paths people take across a fixed set of points (discrete, e.g., nodes and edges). So far I have been using igraph. I haven't found a good way yet (in igraph or another package) to create canonical paths summarizing what significant sub-groups of respondents are doi...

3
голосов
2ответов
1129 просмотров

Partitioning perfect matchings in a bipartite graph

In the 'marriage problem', we have N boys and N girls and an NxN binary matrix telling us which pairings are suitable, and want to pair each girl to a boy. (i.e. we want to find a perfect matching in a bipartite graph). Hall's theorem says that you can find a perfect matching if every collection...

6
голосов
2ответов
1857 просмотров

Automatic graph layout spring theory

I'm trying to position entities visualy to show their relationships to each other. It looks like for automatic graph layout, the spring algorithm would suit my needs. I'd like to implement this in silverlight using c#, so I'm looking for code samples, or links to good explanations of the theory...

4
голосов
3ответов
3295 просмотров

Paths in complete graph

I have a friend that needs to compute the following: In the complete graph Kn (k<=13), there are k*(k-1)/2 edges. Each edge can be directed in 2 ways, hence 2^[(k*(k-1))/2] different cases. She needs to compute P[A !-> B && C !-> D] - P[A !-> B]*P[C !-> D] X !-> Y mea...

2
голосов
4ответов
657 просмотров

Graph Searching algorithm

Here is the problem: I have to find a path from the starting point to the destination with following considerations. In the given graph a point could be either: (1) A Checkpoint--> this point must be there in the final path calculated (2) A Mine--> this point should not be there in the...

0
голосов
4ответов
411 просмотров

Calculating paths in a graph

I have to make a method for making a list with all the paths in a graph.My graph has only one start node and one finish node. Each node has a list whith its children and other list whith its parents. I have to make another list containing all the paths (each of them in another list) Any suggesti...

4
голосов
3ответов
13565 просмотров

Difference between vertices and edges [Graphs, Algorithm and DS]

I've just now started reading an Algorithms book that defined Graphs as follows: Graphs – which represent relationships between arbitrary pairs of objects. Figure 1.8(b) models a network of roads as a graph, where the vertices are cities and the edges are roads connecting pairs of c...

2
голосов
4ответов
2204 просмотров

How to efficiently construct a connected graph?

For fun I'm learning about graph theory and I came across this problem. Given a set of vertices V, a set of edges E, and a weight for each edge in E, how can I efficiently construct a graph G such that: G is connected (all vertices are connected via some path) the sum of the weights of the edge...

2
голосов
1ответов
3808 просмотров

Manhattan layout algorithm

I am looking for any of the following (in order of preference): A Manhattan layout EdgeRenderer for prefuse. A Manhattan layout for prefuse. An algorithm to produce Manhattan layouts for hierarchical, directed acyclic graphs. An organizational chart implementation. Sample implementations incl...

4
голосов
2ответов
1196 просмотров

Add a edge to direct acyclic graph with other restrictions

I have a DAG. I have this operation to add a edge between two nodes. If A is reachable from B, then B is A's parent. If A is reachable from B without going though another node, then B is A's direct parent. Requirements for this graph are: No cycles. For any node, there is a list of direct par...

3
голосов
7ответов
3223 просмотров

What's the simplest and most efficient data structure for building acyclic dependencies?

I'm trying to build a sequence that determines the order to destroy objects. We can assume there are no cycles. If an object A uses an object B during its (A's) construction, then object B should still be available during object A's destruction. Thus the desired order of destruction is A, B. If a...

4
голосов
2ответов
238 просмотров

What program(s) generate grammar graphs?

I see grammar graphs on the websites for SQLite and JSON. What program can be used to generate these pretty pictures?

4
голосов
2ответов
2962 просмотров

Using the apriori algorithm for recommendations

So a recent question made me aware of the rather cool apriori algorithm. I can see why it works, but what I'm not sure about is practical uses. Presumably the main reason to compute related sets of items is to be able to provide recommendations for someone based on their own purchases (or owned i...

2
голосов
5ответов
11594 просмотров

Shortest path between two nodes in a graph (Java)

I have a program with a graph whose nodes represent some processes, and the proccess computing time is the node's cost.This graph is maintainded in memory as a list of nodes and each nod has a list of parent and children, and his execution time. I must find the path with the minimum execution ti...

4
голосов
1ответов
804 просмотров

Hungarian Algorithm and multiple factors

I have a situation where I need to allocate people to several events. If we just had a price as a factor, it would be fine, but there is a number of factors that come in. First, some background. This is for a non-profit organization that promotes story hours for children that are hospitalized fo...

195
голосов
10ответов
181364 просмотров

When should I use Kruskal as opposed to Prim (and vice versa)?

I was wondering when one should use Prim's algorithm and when Kruskal's to find the minimum spanning tree? They both have easy logics, same worst cases, and only difference is implementation which might involve a bit different data structures. So what is the deciding factor?

52
голосов
13ответов
14851 просмотров

Good algorithm for finding the diameter of a (sparse) graph?

I have a large, connected, sparse graph in adjacency-list form. I would like to find two vertices that are as far apart as possible, that is, the diameter of the graph and two vertices achieving it. I am interested in this problem in both the undirected and directed cases, for different applica...

2
голосов
2ответов
1204 просмотров

Finding edge in weighted graph

I have a graph with four nodes, each node represents a position and they are laid out like a two dimensional grid. Every node has a connection (an edge) to all (according to the position) adjacent nodes. Every edge also has a weight. Here are the nodes represented by A,B,C,D and the weight of th...

0
голосов
1ответов
464 просмотров

Core Data Fetched Properties to rank connectivity between Objects

I want to rank how strongly connected instances of Entity A are to other instances or Entity A are in my graph.I only need to do this for the n most recently viewed entities. I describe relations between two instances of Entity A by means of another Entity B. This is because I need to describe ea...

2
голосов
4ответов
2845 просмотров

Graphs (Nodes and Edges)

I am using HASKELL for graph games. I am willing to get a suitable method for reach ability from a node to a particular node in the graph apart from using bfs or trees etc. As I asked for code in haskell for reach ability from one node to a particular node, it is necessary to tell you that I...

10
голосов
8ответов
2998 просмотров

What algorithm can I use to find the shortest path between specified node types in a graph?

This is the problem: I have n points (p1, p2, p3, .. pn), each of them can connect to any other with a determined cost x. Each point belongs to one of a set of point-types (for example "A" "B" "C" "D"...). The input of the method is the path I want to follow, for example "A-B-C-A-D-B". The ou...

9
голосов
5ответов
4768 просмотров

Эффективный способ практиковать алгоритмы теории графов

Я только что прочитал об алгоритме поиска в ширину во введении в алгоритмы. книга и я вручную смоделировали алгоритм на бумаге. Сейчас я хотел бы реализовать это в коде для дополнительной практики. Я думал о реализации всех структур данных с нуля ( список смежности , "цвет", "расстояние" и ...

15
голосов
3ответов
11325 просмотров

Имена алгоритмов обхода графа

Я ищу исчерпывающий список алгоритмов обхода графов с кратким описанием их назначения, чтобы начать их изучение. На данный момент мне известно: Дейкстры - кратчайший путь из одного источника Крускала - находит минимальное остовное дерево Какие еще известные? Пожалуйста, дайте краткое о...

18
голосов
6ответов
7442 просмотров

Вычислить семейные отношения по генеалогическим данным

Я хотел бы иметь возможность рассчитать семейные отношения между двумя людьми в генеалогическом древе, учитывая следующую схему данных (упрощенную из моей реальной схемы данных, показывая только столбцы, которые непосредственно относятся к этой проблеме): individual ---------- id gender chil...

0
голосов
1ответов
1582 просмотров

Нахождение общего количества циклов и длины цикла

Мне интересно найти общее количество циклов и длину циклов в связном неориентированном графе. Могу ли я использовать DFS? Или DFS может найти только один цикл? Любой код обязательно поможет.

6
голосов
3ответов
1161 просмотров

Проверка случайности графа с помощью модели Эрдеша – Реньи?

Имея некоторый график, я хотел бы определить, насколько вероятно, что он был создан случайным образом. Мне сказали, что сравнение с моделью Эрдеша – Реньи было хорошим способом получить эту информацию, но я не совсем понимаю, как это сделать. Есть совет?

4
голосов
3ответов
6065 просмотров

Удаление циклических зависимостей на ориентированном графе с фиксированными ребрами

У меня есть ориентированный циклический граф. Некоторые края ИСПРАВЛЕНЫ и не могут быть удалены. Остальные края можно удалить, чтобы разорвать цикл. Как лучше всего удалить циклы на этом графике? Обход должен быть как можно больше DFS и начинаться с данного узла.