This document discusses graphs and graph representation. It begins by introducing some basic graph terminology like directed and undirected graphs, paths, cycles, trees, and connected components. It then discusses various ways to represent graphs including adjacency lists, adjacency arrays, adjacency matrices, and implicit representations. It provides examples of graph operations and algorithms like recognizing directed acyclic graphs and checking connectivity of interval graphs.
The document discusses a new tool called "Social Impact" that quantifies a person's influence across social networks. It was created by a team that spent a weekend building crawlers to scan social networks, store valuable information, and develop an algorithm to provide a single metric of social impact. The tool offers three services - free individual reports of social impact, standard reports on influential people in certain groups/topics, and premium on-demand reports for customer-provided lists. The goal is to identify the most informationally effective people for spreading messages.
This document appears to be a series of tweets from the Twitter account of Fratboxes, a company started by Nat Eliason that aims to provide party supply boxes to fraternities. The tweets document Eliason and his co-founders' journey starting the company, including early struggles like running out of cups at parties, discussions around how to make money, and mixed customer reactions as they work to build their business.
The document summarizes a proposed mobile app called Cohabit that would help roommates share household tasks and expenses. Over 80% of young adults surveyed were interested in such an app. Cohabit would allow users to create task lists, earn rewards for completing tasks that could be shared with roommates, and integrate with affiliate shopping and expense splitting tools. The business plan outlines acquiring users through college partnerships and social media, and forecasts revenue from advertising, retail partnerships and affiliates to exceed costs by year 3.
Legal Commons - Presentation to Startup Weekend NYC 2009michaelgruen
A startup aims to create standardized, configurable, and understandable legal documents through an online platform similar to Creative Commons for licensing. In its first weekend, the team launched a basic website, created a prototype non-disclosure agreement, and sketched plans for additional documents and a potential for-profit subsidiary to manage legal agreements. Next steps include expanding the collection of documents, building an online user community, and iterating based on feedback.
The document appears to be notes from an event discussing starting a business. It includes references to pitches, attendees, examples, and encouragement to put ideas on paper and be awesome. Key details are the event had over 63,000 attendees from 320 countries, and the notes mention pitching an idea in under 5 minutes and example pitches being given.
The document discusses a new tool called "Social Impact" that quantifies a person's influence across social networks. It was created by a team that spent a weekend building crawlers to scan social networks, store valuable information, and develop an algorithm to provide a single metric of social impact. The tool offers three services - free individual reports of social impact, standard reports on influential people in certain groups/topics, and premium on-demand reports for customer-provided lists. The goal is to identify the most informationally effective people for spreading messages.
This document appears to be a series of tweets from the Twitter account of Fratboxes, a company started by Nat Eliason that aims to provide party supply boxes to fraternities. The tweets document Eliason and his co-founders' journey starting the company, including early struggles like running out of cups at parties, discussions around how to make money, and mixed customer reactions as they work to build their business.
The document summarizes a proposed mobile app called Cohabit that would help roommates share household tasks and expenses. Over 80% of young adults surveyed were interested in such an app. Cohabit would allow users to create task lists, earn rewards for completing tasks that could be shared with roommates, and integrate with affiliate shopping and expense splitting tools. The business plan outlines acquiring users through college partnerships and social media, and forecasts revenue from advertising, retail partnerships and affiliates to exceed costs by year 3.
Legal Commons - Presentation to Startup Weekend NYC 2009michaelgruen
A startup aims to create standardized, configurable, and understandable legal documents through an online platform similar to Creative Commons for licensing. In its first weekend, the team launched a basic website, created a prototype non-disclosure agreement, and sketched plans for additional documents and a potential for-profit subsidiary to manage legal agreements. Next steps include expanding the collection of documents, building an online user community, and iterating based on feedback.
The document appears to be notes from an event discussing starting a business. It includes references to pitches, attendees, examples, and encouragement to put ideas on paper and be awesome. Key details are the event had over 63,000 attendees from 320 countries, and the notes mention pitching an idea in under 5 minutes and example pitches being given.
The document summarizes Odyssey Venture Partners, a Greek venture capital fund focused on technology startups. The fund will be between €30-40M in size and invest in Greek startups pursuing global markets. It will make "Silicon Valley standard" investments of €20,000 to €1.5M, pursuing two investment theses: [1] early-stage Series A funding to help startups reach profitability and €100M in revenue within 5-7 years, and [2] seed funding to stimulate new startup creation and prepare companies for Series A. The management team has experience in both Greece and Silicon Valley and will provide coaching to help portfolio companies succeed globally.
PJ Tech Catalyst is a €15 million seed-stage investment fund that invests in technology startups in Greece. The fund provides equity investments of up to €750k for pre-revenue companies that are typically 6-24 months old. The experienced management team aims to support Greece's startup scene, invest in promising ICT startups, and help them grow into world-class companies. The fund offers startups investment capital as well as access to its network and expertise in technology management, deal structuring, and business development.
Τι να κάνω στη ζωή μου - μια παρουσίαση για εφήβουςGeorge Tziralis
Μου ανατέθηκε πρότινος να δώσω σύντομη ομιλία σε κοινό εφήβων αναφορικά με τον επαγγελματικό τους προσανατολισμό. Κατέληξα να αποφύγω κάποια αναφορά σε συγκεκριμένο κλάδο, για παράδειγμα το τεχνολογικό επιχειρείν και αντί αυτού να εστιάσω σε τροφή για ευρύτερη σκέψη. Ίσως τελικά ανέφερα εκείνα που πρόσφατα συνειδητοποιώ ότι θα ήθελα να είχα ακούσει στην ηλικία αυτή. Παραθέτω εδώ τις διαφάνειες, σύντομο κείμενο θα βρείτε στο gtziralis.com.
The document discusses the benefits of meditation for reducing stress and anxiety. Regular meditation practice can help calm the mind and body by lowering heart rate and blood pressure. Studies have shown that meditating for just 10-20 minutes per day can have significant positive impacts on both mental and physical health.
More textual details here - http://gtziralis.com/innovation-in-practice/
Some simple and straightforward steps on how to be innovative - out of my humble experiences so far
A presentation I gave earlier today at 4th FOSS Conference in Greece, introducing data mining, its principles and application into a wider public, plus showcasing the use ofweka software for all core data mining purposes.
This document discusses the growth of Greek web startups over time. It notes that Greek web startups were once thought to not exist, be unable to succeed, have no interest, and have obscure potential, but that views have changed - they now exist, are able to succeed, have huge interest, and even bigger potential. It acknowledges how far Greek web startups have come but that more potential still lies ahead.
This document introduces askmarkets, a platform that allows users to create their own prediction markets to aggregate information and forecast outcomes. It argues that traditional tools like surveys and meetings are inefficient at tapping into collective intelligence. Prediction markets bring people together, facilitate discussions, synthesize information, and transmit it through prices. The document shows screenshots of Yahoo stock prices on Google Finance to illustrate how news gets incorporated into prices. It then explains that askmarkets allows users to create their own questions, enter predictions, and see collective forecasts form. Users can also create private or public marketplaces for their organizations. The document promotes askmarkets as a wise decision-making tool that is especially useful during tough times.
Based on a telephone survey of 500 households, 57% of the target market thinks a new product will be successful. After a 2 hour meeting, executives agree to move forward with developing a product idea called XYZ. The general sales manager estimates they will sell 5.2 million pieces of the product in 2009.
Analysis Report of Greek Blogosphere by DataMine.itGeorge Tziralis
Sync.gr run an extensive survey on greek blogosphere. Here you may find an extended data mining analysis on the results, provided by http://DataMine.it
This document discusses using prediction markets to aggregate information and forecast events. It notes that traditional markets transmit information through stock prices as news is incorporated. Similarly, prediction markets can be used to forecast things like company sales, project deadlines, or a competitor's market share. The document promotes a website, AskMarkets.com, that allows users to create their own prediction markets to estimate probabilities of future events that matter for their organization or enterprise. Creating and participating in markets on the site is described as a simple process.
A DataMine.it Case Study: Analyzing EarthquakesGeorge Tziralis
The document is a data analysis report prepared by Eirini Lygkoni for George Stamatopoulos that summarizes the results of extensive data mining performed on a seismology data set. The analysis revealed several important rules and patterns relating attributes like earthquake depth, epicenter location, and year to magnitude. Key findings included that earthquakes before 1964 with depths less than 10 km tended to have magnitudes over 6.5, and quakes with epicenters over 38.26 km and depths over 19 km also tended to be over magnitude 6.5.
Quantitative Model For an Impact Measurement SystemGeorge Tziralis
1. The document presents a quantitative model for measuring the impact of factors like tourism on a system using multiple steps.
2. It involves identifying impact factors, structuring them hierarchically, quantifying the effect of each factor using analytic hierarchy process to prioritize them.
3. The most influential factors are then further analyzed using techniques like Paasche's index, Laspeyres' index, and decomposition analysis to quantify their impact over time.
Market Drive Innovation Management, from the inside inGeorge Tziralis
This document discusses using internal markets as a tool for innovation management and idea selection. It notes that traditional evaluation methods are often inefficient and lack motivation. The authors propose allowing employees to trade virtual currency to "buy" and "sell" ideas, with the market prices aggregating information to indicate the most promising concepts. The internal market approach could perform idea selection as a distributed computation, leveraging the power of markets to bring people together, trigger conversations, and efficiently summarize information.
Presenting AskMarkets at the TechCrunch/OpenCoffee event in AthensGeorge Tziralis
Markets of all types, whether stocks, bets or street vendors, bring people together to exchange goods and services. Through prices that transmit information, markets allow people to summarize information, trigger conversations, and get a true sense of any situation in a useful way. All markets essentially operate in the same manner by facilitating interactions that disseminate knowledge.
Tziralis & Ipeirotis at 3rd Prediction Markets WorkshopGeorge Tziralis
A research work by George Tziralis & Panos Ipeirotis.
Detecting Important Events
using Prediction Markets, Text
Mining, and Volatility Modeling.
Presented on July 9th in the 3rd Prediction Markets workshop, Kellog's School of Management, Northwestern University, Chicago
The document summarizes Odyssey Venture Partners, a Greek venture capital fund focused on technology startups. The fund will be between €30-40M in size and invest in Greek startups pursuing global markets. It will make "Silicon Valley standard" investments of €20,000 to €1.5M, pursuing two investment theses: [1] early-stage Series A funding to help startups reach profitability and €100M in revenue within 5-7 years, and [2] seed funding to stimulate new startup creation and prepare companies for Series A. The management team has experience in both Greece and Silicon Valley and will provide coaching to help portfolio companies succeed globally.
PJ Tech Catalyst is a €15 million seed-stage investment fund that invests in technology startups in Greece. The fund provides equity investments of up to €750k for pre-revenue companies that are typically 6-24 months old. The experienced management team aims to support Greece's startup scene, invest in promising ICT startups, and help them grow into world-class companies. The fund offers startups investment capital as well as access to its network and expertise in technology management, deal structuring, and business development.
Τι να κάνω στη ζωή μου - μια παρουσίαση για εφήβουςGeorge Tziralis
Μου ανατέθηκε πρότινος να δώσω σύντομη ομιλία σε κοινό εφήβων αναφορικά με τον επαγγελματικό τους προσανατολισμό. Κατέληξα να αποφύγω κάποια αναφορά σε συγκεκριμένο κλάδο, για παράδειγμα το τεχνολογικό επιχειρείν και αντί αυτού να εστιάσω σε τροφή για ευρύτερη σκέψη. Ίσως τελικά ανέφερα εκείνα που πρόσφατα συνειδητοποιώ ότι θα ήθελα να είχα ακούσει στην ηλικία αυτή. Παραθέτω εδώ τις διαφάνειες, σύντομο κείμενο θα βρείτε στο gtziralis.com.
The document discusses the benefits of meditation for reducing stress and anxiety. Regular meditation practice can help calm the mind and body by lowering heart rate and blood pressure. Studies have shown that meditating for just 10-20 minutes per day can have significant positive impacts on both mental and physical health.
More textual details here - http://gtziralis.com/innovation-in-practice/
Some simple and straightforward steps on how to be innovative - out of my humble experiences so far
A presentation I gave earlier today at 4th FOSS Conference in Greece, introducing data mining, its principles and application into a wider public, plus showcasing the use ofweka software for all core data mining purposes.
This document discusses the growth of Greek web startups over time. It notes that Greek web startups were once thought to not exist, be unable to succeed, have no interest, and have obscure potential, but that views have changed - they now exist, are able to succeed, have huge interest, and even bigger potential. It acknowledges how far Greek web startups have come but that more potential still lies ahead.
This document introduces askmarkets, a platform that allows users to create their own prediction markets to aggregate information and forecast outcomes. It argues that traditional tools like surveys and meetings are inefficient at tapping into collective intelligence. Prediction markets bring people together, facilitate discussions, synthesize information, and transmit it through prices. The document shows screenshots of Yahoo stock prices on Google Finance to illustrate how news gets incorporated into prices. It then explains that askmarkets allows users to create their own questions, enter predictions, and see collective forecasts form. Users can also create private or public marketplaces for their organizations. The document promotes askmarkets as a wise decision-making tool that is especially useful during tough times.
Based on a telephone survey of 500 households, 57% of the target market thinks a new product will be successful. After a 2 hour meeting, executives agree to move forward with developing a product idea called XYZ. The general sales manager estimates they will sell 5.2 million pieces of the product in 2009.
Analysis Report of Greek Blogosphere by DataMine.itGeorge Tziralis
Sync.gr run an extensive survey on greek blogosphere. Here you may find an extended data mining analysis on the results, provided by http://DataMine.it
This document discusses using prediction markets to aggregate information and forecast events. It notes that traditional markets transmit information through stock prices as news is incorporated. Similarly, prediction markets can be used to forecast things like company sales, project deadlines, or a competitor's market share. The document promotes a website, AskMarkets.com, that allows users to create their own prediction markets to estimate probabilities of future events that matter for their organization or enterprise. Creating and participating in markets on the site is described as a simple process.
A DataMine.it Case Study: Analyzing EarthquakesGeorge Tziralis
The document is a data analysis report prepared by Eirini Lygkoni for George Stamatopoulos that summarizes the results of extensive data mining performed on a seismology data set. The analysis revealed several important rules and patterns relating attributes like earthquake depth, epicenter location, and year to magnitude. Key findings included that earthquakes before 1964 with depths less than 10 km tended to have magnitudes over 6.5, and quakes with epicenters over 38.26 km and depths over 19 km also tended to be over magnitude 6.5.
Quantitative Model For an Impact Measurement SystemGeorge Tziralis
1. The document presents a quantitative model for measuring the impact of factors like tourism on a system using multiple steps.
2. It involves identifying impact factors, structuring them hierarchically, quantifying the effect of each factor using analytic hierarchy process to prioritize them.
3. The most influential factors are then further analyzed using techniques like Paasche's index, Laspeyres' index, and decomposition analysis to quantify their impact over time.
Market Drive Innovation Management, from the inside inGeorge Tziralis
This document discusses using internal markets as a tool for innovation management and idea selection. It notes that traditional evaluation methods are often inefficient and lack motivation. The authors propose allowing employees to trade virtual currency to "buy" and "sell" ideas, with the market prices aggregating information to indicate the most promising concepts. The internal market approach could perform idea selection as a distributed computation, leveraging the power of markets to bring people together, trigger conversations, and efficiently summarize information.
Presenting AskMarkets at the TechCrunch/OpenCoffee event in AthensGeorge Tziralis
Markets of all types, whether stocks, bets or street vendors, bring people together to exchange goods and services. Through prices that transmit information, markets allow people to summarize information, trigger conversations, and get a true sense of any situation in a useful way. All markets essentially operate in the same manner by facilitating interactions that disseminate knowledge.
Tziralis & Ipeirotis at 3rd Prediction Markets WorkshopGeorge Tziralis
A research work by George Tziralis & Panos Ipeirotis.
Detecting Important Events
using Prediction Markets, Text
Mining, and Volatility Modeling.
Presented on July 9th in the 3rd Prediction Markets workshop, Kellog's School of Management, Northwestern University, Chicago
Tziralis & Ipeirotis at 3rd Prediction Markets Workshop
George Saliaris Faseas at Open Coffee Athens XVI
1. Sanders: Graphs 1
Graphs and Graph Representation INFORMATIK
¾ 1736 L. Euler asks about a
“touristic” question:
¾ Street or Computer networks
¾ Railway connections (space and time)
¾ Citation or Coauthorship social networks
¾ Job precedences scheduling problems
¾ Values and arithmetic operations compiler construction
¾
2. Sanders: Graphs
1 Mathematical View: Just Sets and Pairs INFORMATIK
Often terminology is already reason enough for a graph model
1.1 Directed Graphs
´Î µ describes a directed graph with vertex set Î and edge set
¢ .
Î Î
Convention: and Ñ
Ò Î
1.1.1 Special Cases (usually disallowed)
Multigraphs: parallel edges allowed, i.e, is a multiset.
self loops: edges ´Ú Úµ
4. Sanders: Graphs
¾ ¾
´Ù ´Ú INFORMATIK
Bidirected graph: Úµ Ùµ
1.2 Undirected Graphs
streamlined description of a bidirected graph where edges are two element
vertex sets.
° ´Ù ´Ú
ÙÚ Úµ Ùµ
degree´Úµ in-degree´Úµ out-degree´Úµ
What about self loops?
5. Sanders: Graphs 5
1.3 Subgraphs INFORMATIK
¼ ´Î ¼ ¼ µ is subgraph of µ if Î ¼ ¼¾
´Î and
Î
¼ is vertex induced by Î ¼ if ¼ ¼ ¼
¾ ¾ ¾
´Ù Úµ Ù Î Ú Î
6. Sanders: Graphs
1.4 Associated Information INFORMATIK
Ê
edge weights Û
Example: Length or traffic capacity of a street,
we will see more things like node potentials, node/vertex colors,
7. Sanders: Graphs 7
1.5 Paths INFORMATIK
A path Ô Ú¼ Ú
of length connects nodes Ú¼ and Ú if
subsequent nodes in Ô are connected by edges in , i.e,
¾ ¾ ¾
½
´Ú¼ Ú½ µ ´Ú½ Ú¾ µ ´Ú µ
,¾ , , .
½ Ú
edge representation: .
½
Ô
simple path: Ú¼ , ,Ú different.
Nonsimple paths are usually called walks.
È
µ.
In weighted graphs, length is ½ Û´
bottleneck weight: Ñ Ò µ.
½ Û´
Applications: What is the shortest route from Saarbrucken to Paris?
¨
How much traffic can it carry?
8. Sanders: Graphs
1.6 Cycles INFORMATIK
Cycles are paths that share the first and the last node
A cycle is simple if all other nodes are different.
Hamiltonian cycle: simple cycle that visits all nodes.
Euler cycle: cycle (cyclic walk) that visits all edges once
back to the bridge problem. But we need one more term.
9. Sanders: Graphs 9
1.7 Connectedness INFORMATIK
¸ ¾
is strongly connected path Ô connects Ù and Ú
ÙÚ Î Ô
drop the “strongly” for undirected graphs
A connected component is a maximal connected vertex induced subgraph
10. Sanders: Graphs
1.8 Euler Tours INFORMATIK
Theorem 1. is Eulerian (has an Euler tour) if and only if is connected
and every node has even degree.
Proof: Necessity: connectedness is clear.
½.
Consider a node Ú with degree ¾
The tour is stuck when it visits Ú the -th time.
Sufficiency:
Step 1, Construct Euler Paritioning of into a set of cycles:
Greedily build any walk. Remove visited edges.
When you get stuck, you have closed a cycle.
Step 2, Glue the cycles together.
Possible since any cycle intersects some other cycle.
11. Sanders: Graphs 11
1.9 Trees INFORMATIK
An undirected graph is a tree if there is exactly one path between any pair of
nodes.
Exercise: Prove that the following properties are equivalent
1. is a tree.
½ edges.
2. is connected and has exactly Ò
3. is connected and contains no cycles.
Forest: undirected acyclic graph
Directed acyclic graph (DAG): no cycles.
Exercise: How many edges are possible?
12. Sanders: Graphs
1.10 Directed Trees? INFORMATIK
we need a special root node Ö.
¾
exactly one Ö path or
Ú Î Ú
¾
exactly one Ú path
Ú Î Ö
CS trees have the root at the top.
a parent is immediately above its children or successors which are siblings.
(ancestors, ) Nodes without children are leaves.
Nonroot nonleaf nodes are interior.
ordered trees: order of children matters. Example: search trees.
13. Sanders: Graphs 13
2 Graph Representation INFORMATIK
we mostly represent undirected graphs as bidirected graphs
focus on directed graphs
Overview:
¾ Operations are what matters
¾ A trivial representation
¾ Arrays
¾ Linked Lists
¾ Matrices
¾ Implicit Representation
¾ Discussion
14. Sanders: Graphs
2.1 Operations INFORMATIK
Ç´½µ time for all elementary operations
Goal:
Access associated information. Use arrays. Perhaps hash tables.
½
One reason for Î Ò.
Navigation: Given Ú find outgoing edges. (We may also want incoming edges.)
¾
Edge queries: ´Ù ? Adjanceny matrices, hash tables.
Úµ
Reverse access: Given ´Ù find ´Ú
Úµ Ùµ
Construction conversion and output (Ç´Ñ · Òµ time)
Update: Insert/delete nodes/edges. This is the hard part.
15. Sanders: Graphs 15
Example: Recognizing DAGs INFORMATIK
¾ ¼ do delete Ú
while out-degree´Úµ
Ú Î
if Î then output “ is a DAG”
else output “ contains a cycle”
// to find a cycle, pick any node and follow edges
works because we never destroy or introduce cycles
Ç´Ñ ·
Exercise: implement it in time Òµ
16. Sanders: Graphs
2.2 Edge Sequence Representation INFORMATIK
Sequence of node pairs (or triples with edge weight)
· Compact
· Good for I/O
Almost no useful operations except scanning all edges
Not so bad with some additional node arrays.
Examples: Find isolated nodes, several MST algorithms, conversion.
17. Sanders: Graphs 17
2.3 Adjacency Arrays INFORMATIK
½
¼
Î Ò
Edge array E stores targets
grouping edges leaving a node
Node array V stores index of first outgoing edge
stores Ñ · ½
dummy entry Î Ò
1
0 n−1 4=n
V0 2 466
0 3
E1 2 2 3 1 3
m−1 6=m
0
2
Î
ÎÚ·½
Example: out-degree´Úµ Ú
18. Sanders: Graphs
2.4 Edge List Adjacency Array INFORMATIK
A Reminder: Sorting Small Integers
// make a sorted permutation of
Procedure KSortArray´a,b : Array ½ of 0..K-1µ
Ò
½ of Æ
¼ ¼ : Array ¼
c // counters for each bucket
Ã
for := ½ to Ò do ·· // Count bucket sizes
C := 0
È
½ do ´
:= ¼ to à µ := ´ · µ// Store
for in
for := ½ to Ò do // Distribute
:=
··
Idea: Sort by starting node
19. Sanders: Graphs 19
Integrated Solution INFORMATIK
Ä ×Ø µ
Function adjacencyArray´
of Æ
¼ ¼ : Array ¼
V Ò
¾ EdgeList do
foreach ´Ù ·· // count
Úµ ÎÙ
½
for Ú := ½ to Ò do +=Î // prefix sums
ÎÚ Ú
¾ EdgeList do
foreach ´Ù // place
Úµ ÎÙ Ú
return ´Î µ
Example on Blackboard
20. Sanders: Graphs
Operations for Adjacency Arrays INFORMATIK
Navigation: easy. we will see several applications
Edge weights: becomes array of records
Incoming Edges: another (reverse) edge array
Delete Edges: explicit end indices
Batched Updates: rebuild
21. Sanders: Graphs 21
2.5 Adjacency Lists INFORMATIK
store (doubly linked) list of adjacent edges for each node
(a bit more restricted with singly linked lists)
· easy edge insertion
· easy edge deletion (order preserving)
more space (factor up to 3) than adj. arrays
more cache faults than adj. arrays
22. Sanders: Graphs
Enhancing Adjacency Lists INFORMATIK
For reverse edge access or edge weight updates in undirected graphs:
explicit edge objects
¾ stores weights
¾ pred/succ-pointers for all adjacency lists containing this edge
¾ reverse pointer for directed graphs
¾ cute trick: store only xor of incident nodes
23. Sanders: Graphs 23
Node insertion/deletion INFORMATIK
mark as deleted swap in node Ò list of nodes
µ node handles are pointers. 1
0 3
Problem: graphs with common node set
E list out list in list rev from to
2
(0,1) 0 0 0 V list first first deg deg
out in out in
(0,2) 0
0 0 0 0 2 0
(1,2) 1
0 2 2
(1,3) 2
0 00 2 2
(2,1) 3
0 0 0 0 0 2
(2,3) 0 0 0 0
¢ more space than vanilla adjacency arrays
24. Sanders: Graphs
2.6 Customization INFORMATIK
Customize data structure for application for maximum speed/compactness.
Sofware Engineering nightmare
Seperating algorithm from their representation may be a way out
25. Sanders: Graphs 25
Example: Recognizing dags INFORMATIK
¾ ¼ do delete Ú
while out-degree´Úµ
Ú Î
¾ Use adjacency array storing incoming edges
¾ Store out-degrees
¾ Maintain a stack of out-degree zero nodes
¾ delete ´Ù by decrementing out-degree´Ùµ
Úµ
¾ no explicit node deletion
¾ At the end test whether all nodes have out-degree´¼µ
26. Sanders: Graphs
2.7 Adjacency Matrix INFORMATIK
Ò¢Ò with
¾ ¾
¼½ ´ µ ´ µ
· space efficient for very dense matrices
space inefficient otherwise. Exercise: what should “very dense” mean?
· Easy edge queries
Slow navigation (except for dense graphs)
·· joins linear algebra and graph theory
# -edge paths from to
Example: .
Exercise: count -edge paths
Important accelerators:
Ç´ÐÓ µ mat-mults for mat-power
matrix multiplication in subcubic time, e.g., Strassen’s algorithm
27. Sanders: Graphs 27
Example where graph theory helps LA INFORMATIK
Ü ´½ ´ µ ¼µ
Problem: solve Consider Ò
µ
Assume has two connected components
we swap rows and cols such that
¼ ½¼ ½ ¼ ½
¼ ܽ
½ ½
¼ ܾ
¾ ¾
Exercise: What if is a DAG?
28. Sanders: Graphs
2.8 Implicit Representation INFORMATIK
Compact representations of possibly very dense graphs
Implement algorithms directly using this representation
29. Sanders: Graphs 29
Example: Connectedness of Interval Graphs INFORMATIK
ÒÒ
½ ½
Î
and overlap
Idea: sweep intervals from left to right. The number of overlapping intervals
may never drop to zero.
Function isConnected(Ä : SortedListOfIntervalEndPoints) : ¼ ½
remove first element of Ä
overlap := 1
¾
foreach Ô do
Ä
¼ return 0
if overlap
if Ô is a start point then overlap··
else overlap // end point
¾¡
Ç´Ò ÐÓ Ç
algorithm for up to edges! Exercise: find all connected
Òµ Ò
components