Graph theory much use in game programming?

This topic is 1734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

There's an option on my university course to study Graph theory next year, I am wondering how widely it is used in game programming and is it useful?

Thanks in advance for any replies!

Share on other sites
I would say yes, definitely useful.

There would be applications for AI such as path finding.

In graphics there could be certain algorithms you could use that apply operations to mesh data. The vertices of the mesh would be a node in the graph as the edges between them would be the edges of the graph. Edited by HappyCoder

Share on other sites

It's a long time since I studied some graph theory in a combinatorics course, it wasn't useful for games, more about properties of certain graphs (how many trees with N vertices are there? Is this graph planar? Graph colouring stuff (vertices and edge colouring only), Hamiltonian graphs (graphs where you can visit every vertex without traversing the same edge more than once), etc.

It wasn't too hard though so if you want a break from complex analysis I'd recommend it ;) EDIT: And topology. That was really hard as well ;)

EDIT: CS graph theory is probably useful though, I'm talking about combinatoric graph theory.

Share on other sites

It's a long time since I studied some graph theory in a combinatorics course, it wasn't useful for games, more about properties of certain graphs (how many trees with N vertices are there? Is this graph planar? Graph colouring stuff (vertices and edge colouring only), Hamiltonian graphs (graphs where you can visit every vertex without traversing the same edge more than once), etc.

It wasn't too hard though so if you want a break from complex analysis I'd recommend it ;) EDIT: And topology. That was really hard as well ;)

EDIT: CS graph theory is probably useful though, I'm talking about combinatoric graph theory.

Ah, I'm doing topology next year too :D I like it when it's difficult. Generally, difficult courses are a case of, understand it - then it'll be a breeze. Don't understand it, then you'll have many lumps on your forehead by the end of the module.

Share on other sites

Ok, do topology, complex analysis, number theory and Galois theory then if you like hard courses ;)

The stuff you do in Mathematical Graph Theory is basically proofs of properties of certain types of graphs (so you get a proof of which graphs you can draw without taking your pen off the paper [0 or 2 vertices with odd degree], a proof of Nodes + Regions = Edges + 2 and its extension to graphs on non-planar surfaces, stuff about one-coloured subgraphs of a graph with different coloured vertices, stuff like that).

EDIT: Hey, I've thought of a use, you can use it to check whether a network can be drawn on a plane without any crossings, which can be useful for user interface stuff, and there was a game involving untangling crossed wires ;) see:

http://en.wikipedia.org/wiki/Planar_graph

Share on other sites

Ok, do topology, complex analysis, number theory and Galois theory then if you like hard courses ;)

The stuff you do in Mathematical Graph Theory is basically proofs of properties of certain types of graphs (so you get a proof of which graphs you can draw without taking your pen off the paper [0 or 2 vertices with odd degree], a proof of Nodes + Regions = Edges + 2 and its extension to graphs on non-planar surfaces, stuff about one-coloured subgraphs of a graph with different coloured vertices, stuff like that).

EDIT: Hey, I've thought of a use, you can use it to check whether a network can be drawn on a plane without any crossings, which can be useful for user interface stuff, and there was a game involving untangling crossed wires ;) see:

http://en.wikipedia.org/wiki/Planar_graph

It's unlikely any modules involving complex analysis and number theory will go ahead due to lack of people signing up for them. They haven't ran for the last 3 years in a row. :/ People would rather go down the easy route with statistics.

Share on other sites

Graph theory is actually really useful. After learning more and more graph theory, I keep seeing new ways to decompose old problems (that I struggled with) into graph problems, and there's a plethora of solutions to graph problems to aid you in optimally solving your problem or designing your algorithm. I'd certainly suggest spending some quality time studying graph theory.

I've found the things I've learned while studying graph theory useful for a wide variety of programs I've worked on, from video games to compilers.

Share on other sites

Graph theory is actually really useful. After learning more and more graph theory, I keep seeing new ways to decompose old problems (that I struggled with) into graph problems, and there's a plethora of solutions to graph problems to aid you in optimally solving your problem or designing your algorithm. I'd certainly suggest spending some quality time studying graph theory.

I've found the things I've learned while studying graph theory useful for a wide variety of programs I've worked on, from video games to compilers.

Thanks for reply, it's looking quite an attractive option now. :)

Share on other sites
I think it is important for any programmer to be comfortable with several graph algorithms (topological sorting, depth-first search, breath-first search, Dijkstra's algorithm, A*, maximum flow...), but the typical things you study in a Graph Theory class are not that useful.