Bipartite Graphs

Mahesh Parahar
Updated on 23-Aug-2019 06:27:37

7K+ Views

Bipartite Graph - If the vertex-set of a graph G can be split into two disjoint sets, V1 and V2 , in such a way that each edge in the graph joins a vertex in V1 to a vertex in V2 , and there are no edges in G that connect two vertices in V1 or two vertices in V2 , then the graph G is called a bipartite graph.Complete Bipartite Graph - A complete bipartite graph is a bipartite graph in which each vertex in the first set is joined to every single vertex in the second set. The ... Read More

Basic Concepts of Graphs

Mahesh Parahar
Updated on 23-Aug-2019 06:25:16

5K+ Views

A graph is a set of points, called nodes or vertices, which are interconnected by a set of lines called edges. The study of graphs, or graph theory is an important part of a number of disciplines in the fields of mathematics, engineering and computer science.Graph TheoryDefinition − A graph (denoted as G = (V, E)) consists of a non-empty set of vertices or nodes V and a set of edges E. A vertex a  represents an endpoint of an edge. An edge joins two vertices a, b  and is represented by set of vertices it connects.Example − Let us ... Read More

Inference Theory of Predicate Logic

Mahesh Parahar
Updated on 23-Aug-2019 06:24:55

2K+ Views

To reach a conclusion on quantified statements, there are four rules of inference which are collectively called as Inference Theory of the Predicate Calculus.Table of Rules of InferenceRule of InferenceName$$\begin{matrix} \forall x P(x) \ \hline \therefore P(y) \end{matrix}$$Rule US: Universal Specification$$\begin{matrix} P(c) \text { for any c} \ \hline \therefore \forall x P(x) \end{matrix}$$Rule UG: Universal Generalization$$\begin{matrix} \exists x P(x) \ \hline \therefore P(c) \text { for any c} \ \end{matrix}$$Rule ES: Existential Specification$$\begin{matrix} P(c) \text { for any c} \ \therefore \exists x P(x) \end{matrix}$$Rule EG: Existential GeneralizationRule US: Universal Specification - From $(x)P(x)$, one can conclude $P(y)$.Rule US: ... Read More

Select Next Row After Skipping Every 2 Rows in MySQL

AmitDiwan
Updated on 23-Aug-2019 06:21:05

423 Views

To skip rows, you can use OFFSET. Let us first create a table −mysql> create table DemoTable617(Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(100)); Query OK, 0 rows affected (1.70 sec)Insert some records in the table using insert command −mysql> insert into DemoTable617(FirstName) values('John'); Query OK, 1 row affected (0.39 sec) mysql> insert into DemoTable617(FirstName) values('Sam'); Query OK, 1 row affected (0.39 sec) mysql> insert into DemoTable617(FirstName) values('Carol'); Query OK, 1 row affected (0.24 sec) mysql> insert into DemoTable617(FirstName) values('Mike'); Query OK, 1 row affected (0.34 sec) mysql> insert into DemoTable617(FirstName) values('David'); Query OK, 1 row affected (0.17 sec) ... Read More

Independent Line Set

Mahesh Parahar
Updated on 23-Aug-2019 06:20:48

458 Views

Independent sets are represented in sets, in whichthere should not be any edges adjacent to each other. There should not be any common vertex between any two edges.there should not be any vertices adjacent to each other. There should not be any common edge between any two vertices.Independent Line SetLet 'G' = (V, E) be a graph. A subset L of E is called an independent line set of 'G' if no two edges in L are adjacent. Such a set is called an independent line set.ExampleLet us consider the following subsets −L1 = {a, b} L2 = {a, b} ... Read More

Add Column Values with Suffixed Currency Sign in MySQL

AmitDiwan
Updated on 23-Aug-2019 06:15:11

224 Views

For this, you can use aggregate function SUM(). Let us first create a table:mysql> create table DemoTable616 (Price varchar(100)); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable616 values('€200.00'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable616 values('€300.00'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable616 values('€500.00'); Query OK, 1 row affected (0.12 sec)Display all records from the table using select statement −mysql> select *from DemoTable616;This will produce the following output −+-----------+ | Price     | +-----------+ | €200.00 | | ... Read More

Independent Vertex Set

Mahesh Parahar
Updated on 23-Aug-2019 05:51:26

417 Views

Independent sets are represented in sets, in whichthere should not be any edges adjacent to each other. There should not be any common vertex between any two edges.there should not be any vertices adjacent to each other. There should not be any common edge between any two vertices.Independent Vertex SetLet 'G' = (V, E) be a graph. A subset of 'V' is called an independent set of 'G' if no two vertices in 'S' are adjacent.ExampleConsider the following subsets from the above graphs −S1 = {e} S2 = {e, f} S3 = {a, g, c} S4 = {e, d}Clearly, S1 ... Read More

Delete Specific Record by Employee ID in MySQL

AmitDiwan
Updated on 22-Aug-2019 14:11:16

349 Views

Let us first create a table −mysql> create table DemoTable615 (EmployeeId varchar(100), EmployeeName varchar(100)); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable615 values('EMP-101', 'Adam'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable615 values('EMP-1001', 'David'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable615 values('EMP-1002', 'Chris'); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable615 values('EMP-1003', 'Robert'); Query OK, 1 row affected (0.21 sec)Display all records from the table using select statement −mysql> select *from DemoTable615;This will produce the following output −+------------+--------------+ | ... Read More

Return Similar Names from Different Columns in MySQL

AmitDiwan
Updated on 22-Aug-2019 13:57:26

116 Views

For this, use LTRIM() and RTRIM(), since the names are similar but have different left and right space allocations. For example, “ John “ and “John”.Let us first create a table −mysql> create table DemoTable614 (EnterName varchar(100), ReennterName varchar(100)); Query OK, 0 rows affected (0.97 sec)Insert some records in the table using insert command −mysql> insert into DemoTable614 values(' John ', 'John'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable614 values('Carol ', 'Bob'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable614 values('David ', 'David'); Query OK, 1 row affected (0.23 sec)Display all records from ... Read More

Perform MySQL Update with AND Operator

AmitDiwan
Updated on 22-Aug-2019 13:53:51

117 Views

Let us first create a table −mysql> create table DemoTable613 (Id int, Age int, isMarried tinyint(1)); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable613 values(100, 29, 0); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable613 values(200, 22, 0); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable613 values(300, 30, 1); Query OK, 1 row affected (0.19 sec)Display all records from the table using select statement −mysql> select *from DemoTable613;This will produce the following output −+------+------+-----------+ | Id   | Age  | isMarried | +------+------+-----------+ ... Read More

Advertisements